From 3635abdc14179ee59bb19dbc39cca9e166ea7178 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 1 Nov 2022 20:40:35 +0000 Subject: [PATCH] CodeGen from PR 21232 in Azure/azure-rest-api-specs Merge 0b986afba533aede03ac8ca29800cff996ff4126 into 5594dbe2bbc025bb042dee169a7ab3959853dc6d --- sdk/compute/azure-mgmt-compute/_meta.json | 8 +- .../mgmt/compute/v2015_06_15/__init__.py | 4 +- .../compute/v2015_06_15/_configuration.py | 8 +- .../mgmt/compute/v2015_06_15/_metadata.json | 2 +- .../mgmt/compute/v2015_06_15/_version.py | 2 +- .../mgmt/compute/v2015_06_15/aio/__init__.py | 4 +- .../compute/v2015_06_15/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 15 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 19 +- .../_virtual_machine_images_operations.py | 15 +- ...irtual_machine_scale_set_vms_operations.py | 35 ++-- .../_virtual_machine_scale_sets_operations.py | 51 ++--- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 49 ++--- .../compute/v2015_06_15/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 25 ++- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 27 +-- .../_virtual_machine_images_operations.py | 25 ++- ...irtual_machine_scale_set_vms_operations.py | 53 +++--- .../_virtual_machine_scale_sets_operations.py | 79 ++++---- .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 82 ++++---- .../mgmt/compute/v2016_03_30/__init__.py | 4 +- .../compute/v2016_03_30/_configuration.py | 8 +- .../mgmt/compute/v2016_03_30/_metadata.json | 2 +- .../mgmt/compute/v2016_03_30/_version.py | 2 +- .../mgmt/compute/v2016_03_30/aio/__init__.py | 4 +- .../compute/v2016_03_30/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 17 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 19 +- .../_virtual_machine_images_operations.py | 15 +- ...irtual_machine_scale_set_vms_operations.py | 35 ++-- .../_virtual_machine_scale_sets_operations.py | 51 ++--- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 51 ++--- .../compute/v2016_03_30/models/_models_py3.py | 19 +- .../_availability_sets_operations.py | 29 +-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 27 +-- .../_virtual_machine_images_operations.py | 25 ++- ...irtual_machine_scale_set_vms_operations.py | 53 +++--- .../_virtual_machine_scale_sets_operations.py | 79 ++++---- .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 86 +++++---- .../compute/v2016_04_30_preview/__init__.py | 4 +- .../v2016_04_30_preview/_configuration.py | 8 +- .../v2016_04_30_preview/_metadata.json | 2 +- .../compute/v2016_04_30_preview/_version.py | 2 +- .../v2016_04_30_preview/aio/__init__.py | 4 +- .../v2016_04_30_preview/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 29 ++- .../aio/operations/_disks_operations.py | 57 ++++-- .../aio/operations/_images_operations.py | 33 +++- .../aio/operations/_snapshots_operations.py | 57 ++++-- .../aio/operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 33 +++- .../_virtual_machine_images_operations.py | 25 ++- ...irtual_machine_scale_set_vms_operations.py | 73 +++++-- .../_virtual_machine_scale_sets_operations.py | 105 +++++++--- .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 103 +++++++--- .../v2016_04_30_preview/models/_models_py3.py | 19 +- .../_availability_sets_operations.py | 53 ++++-- .../operations/_disks_operations.py | 89 +++++++-- .../operations/_images_operations.py | 53 ++++-- .../operations/_snapshots_operations.py | 89 +++++++-- .../operations/_usage_operations.py | 13 +- ...ual_machine_extension_images_operations.py | 29 ++- .../_virtual_machine_extensions_operations.py | 49 +++-- .../_virtual_machine_images_operations.py | 45 ++++- ...irtual_machine_scale_set_vms_operations.py | 113 ++++++++--- .../_virtual_machine_scale_sets_operations.py | 165 ++++++++++++---- .../_virtual_machine_sizes_operations.py | 13 +- .../_virtual_machines_operations.py | 170 +++++++++++++---- .../mgmt/compute/v2017_03_30/__init__.py | 4 +- .../compute/v2017_03_30/_configuration.py | 8 +- .../mgmt/compute/v2017_03_30/_metadata.json | 2 +- .../mgmt/compute/v2017_03_30/_version.py | 2 +- .../mgmt/compute/v2017_03_30/aio/__init__.py | 4 +- .../compute/v2017_03_30/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 17 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_images_operations.py | 19 +- .../operations/_resource_skus_operations.py | 7 +- .../aio/operations/_snapshots_operations.py | 31 +-- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 19 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 9 +- ...machine_scale_set_extensions_operations.py | 17 +- ...e_scale_set_rolling_upgrades_operations.py | 15 +- ...irtual_machine_scale_set_vms_operations.py | 39 ++-- .../_virtual_machine_scale_sets_operations.py | 59 +++--- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 67 ++++--- .../compute/v2017_03_30/models/_models_py3.py | 19 +- .../_availability_sets_operations.py | 29 +-- .../operations/_disks_operations.py | 47 +++-- .../operations/_images_operations.py | 29 +-- .../operations/_resource_skus_operations.py | 9 +- .../operations/_snapshots_operations.py | 47 +++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 27 +-- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 13 +- ...machine_scale_set_extensions_operations.py | 25 ++- ...e_scale_set_rolling_upgrades_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 59 +++--- .../_virtual_machine_scale_sets_operations.py | 91 ++++----- .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 112 ++++++----- .../mgmt/compute/v2017_09_01/__init__.py | 4 +- .../compute/v2017_09_01/_configuration.py | 8 +- .../mgmt/compute/v2017_09_01/_metadata.json | 2 +- .../mgmt/compute/v2017_09_01/_version.py | 2 +- .../mgmt/compute/v2017_09_01/aio/__init__.py | 4 +- .../compute/v2017_09_01/aio/_configuration.py | 8 +- .../operations/_resource_skus_operations.py | 7 +- .../operations/_resource_skus_operations.py | 9 +- .../mgmt/compute/v2017_12_01/__init__.py | 4 +- .../compute/v2017_12_01/_configuration.py | 8 +- .../mgmt/compute/v2017_12_01/_metadata.json | 2 +- .../mgmt/compute/v2017_12_01/_version.py | 2 +- .../mgmt/compute/v2017_12_01/aio/__init__.py | 4 +- .../compute/v2017_12_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2017_12_01/aio/operations/_operations.py | 7 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 19 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 9 +- ...machine_scale_set_extensions_operations.py | 17 +- ...e_scale_set_rolling_upgrades_operations.py | 15 +- ...irtual_machine_scale_set_vms_operations.py | 51 ++--- .../_virtual_machine_scale_sets_operations.py | 71 +++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 71 +++---- .../compute/v2017_12_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2017_12_01/operations/_operations.py | 9 +- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 27 +-- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 13 +- ...machine_scale_set_extensions_operations.py | 25 ++- ...e_scale_set_rolling_upgrades_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 77 ++++---- .../_virtual_machine_scale_sets_operations.py | 111 +++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 118 ++++++------ .../mgmt/compute/v2018_04_01/__init__.py | 4 +- .../compute/v2018_04_01/_configuration.py | 8 +- .../mgmt/compute/v2018_04_01/_metadata.json | 2 +- .../mgmt/compute/v2018_04_01/_version.py | 2 +- .../mgmt/compute/v2018_04_01/aio/__init__.py | 4 +- .../compute/v2018_04_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2018_04_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../aio/operations/_snapshots_operations.py | 31 +-- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 9 +- ...machine_scale_set_extensions_operations.py | 17 +- ...e_scale_set_rolling_upgrades_operations.py | 15 +- ...irtual_machine_scale_set_vms_operations.py | 55 +++--- .../_virtual_machine_scale_sets_operations.py | 71 +++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 69 +++---- .../compute/v2018_04_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- .../operations/_disks_operations.py | 47 +++-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2018_04_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../operations/_snapshots_operations.py | 47 +++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 13 +- ...machine_scale_set_extensions_operations.py | 25 ++- ...e_scale_set_rolling_upgrades_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 83 ++++---- .../_virtual_machine_scale_sets_operations.py | 111 +++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 114 ++++++----- .../mgmt/compute/v2018_06_01/__init__.py | 4 +- .../compute/v2018_06_01/_configuration.py | 8 +- .../mgmt/compute/v2018_06_01/_metadata.json | 2 +- .../mgmt/compute/v2018_06_01/_version.py | 2 +- .../mgmt/compute/v2018_06_01/aio/__init__.py | 4 +- .../compute/v2018_06_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_galleries_operations.py | 19 +- .../_gallery_image_versions_operations.py | 17 +- .../operations/_gallery_images_operations.py | 17 +- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2018_06_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../aio/operations/_snapshots_operations.py | 31 +-- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 9 +- ...machine_scale_set_extensions_operations.py | 17 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...irtual_machine_scale_set_vms_operations.py | 55 +++--- .../_virtual_machine_scale_sets_operations.py | 71 +++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 73 +++---- .../compute/v2018_06_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- .../operations/_disks_operations.py | 47 +++-- .../operations/_galleries_operations.py | 29 +-- .../_gallery_image_versions_operations.py | 25 ++- .../operations/_gallery_images_operations.py | 25 ++- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2018_06_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../operations/_snapshots_operations.py | 47 +++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 13 +- ...machine_scale_set_extensions_operations.py | 25 ++- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...irtual_machine_scale_set_vms_operations.py | 83 ++++---- .../_virtual_machine_scale_sets_operations.py | 111 +++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 120 ++++++------ .../mgmt/compute/v2018_09_30/__init__.py | 4 +- .../compute/v2018_09_30/_configuration.py | 8 +- .../mgmt/compute/v2018_09_30/_metadata.json | 2 +- .../mgmt/compute/v2018_09_30/_version.py | 2 +- .../mgmt/compute/v2018_09_30/aio/__init__.py | 4 +- .../compute/v2018_09_30/aio/_configuration.py | 8 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_snapshots_operations.py | 31 +-- .../operations/_disks_operations.py | 47 +++-- .../operations/_snapshots_operations.py | 47 +++-- .../mgmt/compute/v2018_10_01/__init__.py | 4 +- .../compute/v2018_10_01/_configuration.py | 8 +- .../mgmt/compute/v2018_10_01/_metadata.json | 2 +- .../mgmt/compute/v2018_10_01/_version.py | 2 +- .../mgmt/compute/v2018_10_01/aio/__init__.py | 4 +- .../compute/v2018_10_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2018_10_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 9 +- ...machine_scale_set_extensions_operations.py | 17 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...irtual_machine_scale_set_vms_operations.py | 55 +++--- .../_virtual_machine_scale_sets_operations.py | 71 +++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 73 +++---- .../compute/v2018_10_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2018_10_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 13 +- ...machine_scale_set_extensions_operations.py | 25 ++- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...irtual_machine_scale_set_vms_operations.py | 83 ++++---- .../_virtual_machine_scale_sets_operations.py | 111 +++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 120 ++++++------ .../mgmt/compute/v2019_03_01/__init__.py | 4 +- .../compute/v2019_03_01/_configuration.py | 8 +- .../mgmt/compute/v2019_03_01/_metadata.json | 2 +- .../mgmt/compute/v2019_03_01/_version.py | 2 +- .../mgmt/compute/v2019_03_01/aio/__init__.py | 4 +- .../compute/v2019_03_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- .../_dedicated_host_groups_operations.py | 17 +- .../operations/_dedicated_hosts_operations.py | 23 ++- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_galleries_operations.py | 19 +- ...gallery_application_versions_operations.py | 17 +- .../_gallery_applications_operations.py | 17 +- .../_gallery_image_versions_operations.py | 17 +- .../operations/_gallery_images_operations.py | 17 +- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2019_03_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../aio/operations/_snapshots_operations.py | 31 +-- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 9 +- ...machine_scale_set_extensions_operations.py | 17 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...irtual_machine_scale_set_vms_operations.py | 57 +++--- .../_virtual_machine_scale_sets_operations.py | 73 +++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 73 +++---- .../compute/v2019_03_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- .../_dedicated_host_groups_operations.py | 29 +-- .../operations/_dedicated_hosts_operations.py | 35 ++-- .../operations/_disks_operations.py | 47 +++-- .../operations/_galleries_operations.py | 29 +-- ...gallery_application_versions_operations.py | 25 ++- .../_gallery_applications_operations.py | 25 ++- .../_gallery_image_versions_operations.py | 25 ++- .../operations/_gallery_images_operations.py | 25 ++- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2019_03_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../operations/_snapshots_operations.py | 47 +++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 13 +- ...machine_scale_set_extensions_operations.py | 25 ++- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...irtual_machine_scale_set_vms_operations.py | 87 +++++---- .../_virtual_machine_scale_sets_operations.py | 115 +++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 120 ++++++------ .../mgmt/compute/v2019_04_01/__init__.py | 4 +- .../compute/v2019_04_01/_configuration.py | 8 +- .../mgmt/compute/v2019_04_01/_metadata.json | 2 +- .../mgmt/compute/v2019_04_01/_version.py | 2 +- .../mgmt/compute/v2019_04_01/aio/__init__.py | 4 +- .../compute/v2019_04_01/aio/_configuration.py | 8 +- .../operations/_resource_skus_operations.py | 7 +- .../operations/_resource_skus_operations.py | 9 +- .../mgmt/compute/v2019_07_01/__init__.py | 4 +- .../compute/v2019_07_01/_configuration.py | 8 +- .../mgmt/compute/v2019_07_01/_metadata.json | 2 +- .../mgmt/compute/v2019_07_01/_version.py | 2 +- .../mgmt/compute/v2019_07_01/aio/__init__.py | 4 +- .../compute/v2019_07_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- .../_dedicated_host_groups_operations.py | 17 +- .../operations/_dedicated_hosts_operations.py | 23 ++- .../_disk_encryption_sets_operations.py | 23 ++- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_galleries_operations.py | 23 ++- ...gallery_application_versions_operations.py | 21 +- .../_gallery_applications_operations.py | 21 +- .../_gallery_image_versions_operations.py | 21 +- .../operations/_gallery_images_operations.py | 21 +- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2019_07_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../aio/operations/_snapshots_operations.py | 31 +-- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 9 +- ...machine_scale_set_extensions_operations.py | 21 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...hine_scale_set_vm_extensions_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 57 +++--- .../_virtual_machine_scale_sets_operations.py | 73 +++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 77 ++++---- .../compute/v2019_07_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- .../_dedicated_host_groups_operations.py | 29 +-- .../operations/_dedicated_hosts_operations.py | 35 ++-- .../_disk_encryption_sets_operations.py | 35 ++-- .../operations/_disks_operations.py | 47 +++-- .../operations/_galleries_operations.py | 35 ++-- ...gallery_application_versions_operations.py | 31 +-- .../_gallery_applications_operations.py | 31 +-- .../_gallery_image_versions_operations.py | 31 +-- .../operations/_gallery_images_operations.py | 31 +-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2019_07_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../operations/_snapshots_operations.py | 47 +++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 13 +- ...machine_scale_set_extensions_operations.py | 31 +-- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...hine_scale_set_vm_extensions_operations.py | 31 +-- ...irtual_machine_scale_set_vms_operations.py | 87 +++++---- .../_virtual_machine_scale_sets_operations.py | 115 +++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 126 ++++++------ .../mgmt/compute/v2019_11_01/__init__.py | 4 +- .../compute/v2019_11_01/_configuration.py | 8 +- .../mgmt/compute/v2019_11_01/_metadata.json | 2 +- .../mgmt/compute/v2019_11_01/_version.py | 2 +- .../mgmt/compute/v2019_11_01/aio/__init__.py | 4 +- .../compute/v2019_11_01/aio/_configuration.py | 8 +- .../_disk_encryption_sets_operations.py | 23 ++- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_snapshots_operations.py | 31 +-- .../_disk_encryption_sets_operations.py | 35 ++-- .../operations/_disks_operations.py | 47 +++-- .../operations/_snapshots_operations.py | 47 +++-- .../mgmt/compute/v2019_12_01/__init__.py | 4 +- .../compute/v2019_12_01/_configuration.py | 8 +- .../mgmt/compute/v2019_12_01/_metadata.json | 2 +- .../mgmt/compute/v2019_12_01/_version.py | 2 +- .../mgmt/compute/v2019_12_01/aio/__init__.py | 4 +- .../compute/v2019_12_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- .../_dedicated_host_groups_operations.py | 17 +- .../operations/_dedicated_hosts_operations.py | 23 ++- .../aio/operations/_galleries_operations.py | 23 ++- ...gallery_application_versions_operations.py | 21 +- .../_gallery_applications_operations.py | 21 +- .../_gallery_image_versions_operations.py | 21 +- .../operations/_gallery_images_operations.py | 21 +- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2019_12_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../operations/_ssh_public_keys_operations.py | 19 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 9 +- ...machine_scale_set_extensions_operations.py | 21 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...hine_scale_set_vm_extensions_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 59 +++--- .../_virtual_machine_scale_sets_operations.py | 77 ++++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 79 ++++---- .../compute/v2019_12_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- .../_dedicated_host_groups_operations.py | 29 +-- .../operations/_dedicated_hosts_operations.py | 35 ++-- .../operations/_galleries_operations.py | 35 ++-- ...gallery_application_versions_operations.py | 31 +-- .../_gallery_applications_operations.py | 31 +-- .../_gallery_image_versions_operations.py | 31 +-- .../operations/_gallery_images_operations.py | 31 +-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2019_12_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../operations/_ssh_public_keys_operations.py | 33 ++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 13 +- ...machine_scale_set_extensions_operations.py | 31 +-- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...hine_scale_set_vm_extensions_operations.py | 31 +-- ...irtual_machine_scale_set_vms_operations.py | 91 ++++----- .../_virtual_machine_scale_sets_operations.py | 121 ++++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 130 +++++++------ .../mgmt/compute/v2020_05_01/__init__.py | 4 +- .../compute/v2020_05_01/_configuration.py | 8 +- .../mgmt/compute/v2020_05_01/_metadata.json | 2 +- .../mgmt/compute/v2020_05_01/_version.py | 2 +- .../mgmt/compute/v2020_05_01/aio/__init__.py | 4 +- .../compute/v2020_05_01/aio/_configuration.py | 8 +- .../operations/_disk_accesses_operations.py | 25 ++- .../_disk_encryption_sets_operations.py | 23 ++- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_snapshots_operations.py | 31 +-- .../operations/_disk_accesses_operations.py | 39 ++-- .../_disk_encryption_sets_operations.py | 35 ++-- .../operations/_disks_operations.py | 47 +++-- .../operations/_snapshots_operations.py | 47 +++-- .../mgmt/compute/v2020_06_01/__init__.py | 4 +- .../compute/v2020_06_01/_configuration.py | 8 +- .../mgmt/compute/v2020_06_01/_metadata.json | 2 +- .../mgmt/compute/v2020_06_01/_version.py | 2 +- .../mgmt/compute/v2020_06_01/aio/__init__.py | 4 +- .../compute/v2020_06_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- .../_dedicated_host_groups_operations.py | 23 ++- .../operations/_dedicated_hosts_operations.py | 23 ++- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2020_06_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../operations/_ssh_public_keys_operations.py | 19 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 25 ++- ...machine_scale_set_extensions_operations.py | 21 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...hine_scale_set_vm_extensions_operations.py | 21 +- ...ne_scale_set_vm_run_commands_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 61 +++--- .../_virtual_machine_scale_sets_operations.py | 77 ++++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 85 +++++---- .../compute/v2020_06_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- .../_dedicated_host_groups_operations.py | 42 ++-- .../operations/_dedicated_hosts_operations.py | 35 ++-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2020_06_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../operations/_ssh_public_keys_operations.py | 33 ++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 39 ++-- ...machine_scale_set_extensions_operations.py | 31 +-- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...hine_scale_set_vm_extensions_operations.py | 31 +-- ...ne_scale_set_vm_run_commands_operations.py | 31 +-- ...irtual_machine_scale_set_vms_operations.py | 95 +++++----- .../_virtual_machine_scale_sets_operations.py | 121 ++++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 140 +++++++------- .../mgmt/compute/v2020_06_30/__init__.py | 4 +- .../compute/v2020_06_30/_configuration.py | 8 +- .../mgmt/compute/v2020_06_30/_metadata.json | 2 +- .../mgmt/compute/v2020_06_30/_version.py | 2 +- .../mgmt/compute/v2020_06_30/aio/__init__.py | 4 +- .../compute/v2020_06_30/aio/_configuration.py | 8 +- .../operations/_disk_accesses_operations.py | 25 ++- .../_disk_encryption_sets_operations.py | 25 ++- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_snapshots_operations.py | 31 +-- .../operations/_disk_accesses_operations.py | 39 ++-- .../_disk_encryption_sets_operations.py | 39 ++-- .../operations/_disks_operations.py | 47 +++-- .../operations/_snapshots_operations.py | 47 +++-- .../mgmt/compute/v2020_09_30/__init__.py | 4 +- .../compute/v2020_09_30/_configuration.py | 8 +- .../mgmt/compute/v2020_09_30/_metadata.json | 2 +- .../mgmt/compute/v2020_09_30/_version.py | 2 +- .../mgmt/compute/v2020_09_30/aio/__init__.py | 4 +- .../compute/v2020_09_30/aio/_configuration.py | 8 +- .../operations/_disk_accesses_operations.py | 37 ++-- .../_disk_encryption_sets_operations.py | 25 ++- .../_disk_restore_point_operations.py | 9 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_galleries_operations.py | 23 ++- ...gallery_application_versions_operations.py | 21 +- .../_gallery_applications_operations.py | 21 +- .../_gallery_image_versions_operations.py | 21 +- .../operations/_gallery_images_operations.py | 21 +- .../_gallery_sharing_profile_operations.py | 9 +- .../_shared_galleries_operations.py | 9 +- ...hared_gallery_image_versions_operations.py | 9 +- .../_shared_gallery_images_operations.py | 9 +- .../aio/operations/_snapshots_operations.py | 31 +-- .../operations/_disk_accesses_operations.py | 59 +++--- .../_disk_encryption_sets_operations.py | 39 ++-- .../_disk_restore_point_operations.py | 13 +- .../operations/_disks_operations.py | 47 +++-- .../operations/_galleries_operations.py | 35 ++-- ...gallery_application_versions_operations.py | 31 +-- .../_gallery_applications_operations.py | 31 +-- .../_gallery_image_versions_operations.py | 31 +-- .../operations/_gallery_images_operations.py | 31 +-- .../_gallery_sharing_profile_operations.py | 11 +- .../_shared_galleries_operations.py | 13 +- ...hared_gallery_image_versions_operations.py | 13 +- .../_shared_gallery_images_operations.py | 13 +- .../operations/_snapshots_operations.py | 47 +++-- .../compute/v2020_10_01_preview/__init__.py | 4 +- .../v2020_10_01_preview/_configuration.py | 8 +- .../v2020_10_01_preview/_metadata.json | 2 +- .../compute/v2020_10_01_preview/_version.py | 2 +- .../v2020_10_01_preview/aio/__init__.py | 4 +- .../v2020_10_01_preview/aio/_configuration.py | 8 +- ...cloud_service_role_instances_operations.py | 61 ++++-- .../_cloud_service_roles_operations.py | 13 +- .../operations/_cloud_services_operations.py | 93 ++++++--- ...cloud_services_update_domain_operations.py | 21 +- ...cloud_service_role_instances_operations.py | 97 +++++++--- .../_cloud_service_roles_operations.py | 21 +- .../operations/_cloud_services_operations.py | 145 ++++++++++---- ...cloud_services_update_domain_operations.py | 33 +++- .../mgmt/compute/v2020_12_01/__init__.py | 4 +- .../compute/v2020_12_01/_configuration.py | 8 +- .../mgmt/compute/v2020_12_01/_metadata.json | 2 +- .../mgmt/compute/v2020_12_01/_version.py | 2 +- .../mgmt/compute/v2020_12_01/aio/__init__.py | 4 +- .../compute/v2020_12_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- .../_dedicated_host_groups_operations.py | 23 ++- .../operations/_dedicated_hosts_operations.py | 23 ++- .../operations/_disk_accesses_operations.py | 37 ++-- .../_disk_encryption_sets_operations.py | 25 ++- .../_disk_restore_point_operations.py | 17 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2020_12_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../aio/operations/_snapshots_operations.py | 31 +-- .../operations/_ssh_public_keys_operations.py | 19 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- ...ual_machine_images_edge_zone_operations.py | 15 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 25 ++- ...machine_scale_set_extensions_operations.py | 21 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...hine_scale_set_vm_extensions_operations.py | 21 +- ...ne_scale_set_vm_run_commands_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 61 +++--- .../_virtual_machine_scale_sets_operations.py | 79 ++++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 89 +++++---- .../compute/v2020_12_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- .../_dedicated_host_groups_operations.py | 42 ++-- .../operations/_dedicated_hosts_operations.py | 35 ++-- .../operations/_disk_accesses_operations.py | 59 +++--- .../_disk_encryption_sets_operations.py | 39 ++-- .../_disk_restore_point_operations.py | 25 ++- .../operations/_disks_operations.py | 47 +++-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2020_12_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../operations/_snapshots_operations.py | 47 +++-- .../operations/_ssh_public_keys_operations.py | 33 ++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- ...ual_machine_images_edge_zone_operations.py | 25 ++- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 39 ++-- ...machine_scale_set_extensions_operations.py | 31 +-- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...hine_scale_set_vm_extensions_operations.py | 31 +-- ...ne_scale_set_vm_run_commands_operations.py | 31 +-- ...irtual_machine_scale_set_vms_operations.py | 95 +++++----- .../_virtual_machine_scale_sets_operations.py | 125 ++++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 146 +++++++------- .../mgmt/compute/v2021_03_01/__init__.py | 4 +- .../compute/v2021_03_01/_configuration.py | 8 +- .../mgmt/compute/v2021_03_01/_metadata.json | 2 +- .../mgmt/compute/v2021_03_01/_version.py | 2 +- .../mgmt/compute/v2021_03_01/aio/__init__.py | 4 +- .../compute/v2021_03_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- ...ud_service_operating_systems_operations.py | 13 +- ...cloud_service_role_instances_operations.py | 29 +-- .../_cloud_service_roles_operations.py | 9 +- .../operations/_cloud_services_operations.py | 49 ++--- ...cloud_services_update_domain_operations.py | 13 +- .../_dedicated_host_groups_operations.py | 17 +- .../operations/_dedicated_hosts_operations.py | 21 +- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2021_03_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../_restore_point_collections_operations.py | 19 +- .../operations/_restore_points_operations.py | 15 +- .../operations/_ssh_public_keys_operations.py | 19 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- ...ual_machine_images_edge_zone_operations.py | 15 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 25 ++- ...machine_scale_set_extensions_operations.py | 21 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...hine_scale_set_vm_extensions_operations.py | 21 +- ...ne_scale_set_vm_run_commands_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 59 +++--- .../_virtual_machine_scale_sets_operations.py | 79 ++++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 87 +++++---- .../compute/v2021_03_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- ...ud_service_operating_systems_operations.py | 21 +- ...cloud_service_role_instances_operations.py | 45 +++-- .../_cloud_service_roles_operations.py | 13 +- .../operations/_cloud_services_operations.py | 75 ++++---- ...cloud_services_update_domain_operations.py | 19 +- .../_dedicated_host_groups_operations.py | 29 +-- .../operations/_dedicated_hosts_operations.py | 31 +-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2021_03_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../_restore_point_collections_operations.py | 31 +-- .../operations/_restore_points_operations.py | 21 +- .../operations/_ssh_public_keys_operations.py | 33 ++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- ...ual_machine_images_edge_zone_operations.py | 25 ++- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 39 ++-- ...machine_scale_set_extensions_operations.py | 31 +-- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...hine_scale_set_vm_extensions_operations.py | 31 +-- ...ne_scale_set_vm_run_commands_operations.py | 31 +-- ...irtual_machine_scale_set_vms_operations.py | 91 ++++----- .../_virtual_machine_scale_sets_operations.py | 125 ++++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 137 +++++++------- .../mgmt/compute/v2021_04_01/__init__.py | 4 +- .../compute/v2021_04_01/_configuration.py | 8 +- .../mgmt/compute/v2021_04_01/_metadata.json | 2 +- .../mgmt/compute/v2021_04_01/_version.py | 2 +- .../mgmt/compute/v2021_04_01/aio/__init__.py | 4 +- .../compute/v2021_04_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- ..._capacity_reservation_groups_operations.py | 17 +- .../_capacity_reservations_operations.py | 21 +- .../_dedicated_host_groups_operations.py | 17 +- .../operations/_dedicated_hosts_operations.py | 21 +- .../operations/_disk_accesses_operations.py | 37 ++-- .../_disk_encryption_sets_operations.py | 25 ++- .../_disk_restore_point_operations.py | 17 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2021_04_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../_restore_point_collections_operations.py | 19 +- .../operations/_restore_points_operations.py | 15 +- .../aio/operations/_snapshots_operations.py | 31 +-- .../operations/_ssh_public_keys_operations.py | 19 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- ...ual_machine_images_edge_zone_operations.py | 15 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 25 ++- ...machine_scale_set_extensions_operations.py | 21 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...hine_scale_set_vm_extensions_operations.py | 21 +- ...ne_scale_set_vm_run_commands_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 59 +++--- .../_virtual_machine_scale_sets_operations.py | 79 ++++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 87 +++++---- .../compute/v2021_04_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- ..._capacity_reservation_groups_operations.py | 29 +-- .../_capacity_reservations_operations.py | 31 +-- .../_dedicated_host_groups_operations.py | 29 +-- .../operations/_dedicated_hosts_operations.py | 31 +-- .../operations/_disk_accesses_operations.py | 59 +++--- .../_disk_encryption_sets_operations.py | 39 ++-- .../_disk_restore_point_operations.py | 25 ++- .../operations/_disks_operations.py | 47 +++-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2021_04_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../_restore_point_collections_operations.py | 31 +-- .../operations/_restore_points_operations.py | 21 +- .../operations/_snapshots_operations.py | 47 +++-- .../operations/_ssh_public_keys_operations.py | 33 ++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- ...ual_machine_images_edge_zone_operations.py | 25 ++- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 39 ++-- ...machine_scale_set_extensions_operations.py | 31 +-- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...hine_scale_set_vm_extensions_operations.py | 31 +-- ...ne_scale_set_vm_run_commands_operations.py | 31 +-- ...irtual_machine_scale_set_vms_operations.py | 91 ++++----- .../_virtual_machine_scale_sets_operations.py | 125 ++++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 137 +++++++------- .../mgmt/compute/v2021_07_01/__init__.py | 4 +- .../compute/v2021_07_01/_configuration.py | 8 +- .../mgmt/compute/v2021_07_01/_metadata.json | 2 +- .../mgmt/compute/v2021_07_01/_version.py | 2 +- .../mgmt/compute/v2021_07_01/aio/__init__.py | 4 +- .../compute/v2021_07_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- ..._capacity_reservation_groups_operations.py | 17 +- .../_capacity_reservations_operations.py | 21 +- .../_community_galleries_operations.py | 7 +- ...unity_gallery_image_versions_operations.py | 7 +- .../_community_gallery_images_operations.py | 7 +- .../_dedicated_host_groups_operations.py | 17 +- .../operations/_dedicated_hosts_operations.py | 21 +- .../aio/operations/_galleries_operations.py | 23 ++- ...gallery_application_versions_operations.py | 21 +- .../_gallery_applications_operations.py | 21 +- .../_gallery_image_versions_operations.py | 21 +- .../operations/_gallery_images_operations.py | 21 +- .../_gallery_sharing_profile_operations.py | 9 +- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2021_07_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../operations/_resource_skus_operations.py | 7 +- .../_restore_point_collections_operations.py | 19 +- .../operations/_restore_points_operations.py | 15 +- .../_shared_galleries_operations.py | 9 +- ...hared_gallery_image_versions_operations.py | 9 +- .../_shared_gallery_images_operations.py | 9 +- .../operations/_ssh_public_keys_operations.py | 19 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- ...ual_machine_images_edge_zone_operations.py | 15 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 25 ++- ...machine_scale_set_extensions_operations.py | 21 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...hine_scale_set_vm_extensions_operations.py | 21 +- ...ne_scale_set_vm_run_commands_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 59 +++--- .../_virtual_machine_scale_sets_operations.py | 79 ++++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 87 +++++---- .../compute/v2021_07_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- ..._capacity_reservation_groups_operations.py | 29 +-- .../_capacity_reservations_operations.py | 31 +-- .../_community_galleries_operations.py | 9 +- ...unity_gallery_image_versions_operations.py | 9 +- .../_community_gallery_images_operations.py | 9 +- .../_dedicated_host_groups_operations.py | 29 +-- .../operations/_dedicated_hosts_operations.py | 31 +-- .../operations/_galleries_operations.py | 35 ++-- ...gallery_application_versions_operations.py | 31 +-- .../_gallery_applications_operations.py | 31 +-- .../_gallery_image_versions_operations.py | 31 +-- .../operations/_gallery_images_operations.py | 31 +-- .../_gallery_sharing_profile_operations.py | 11 +- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2021_07_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../operations/_resource_skus_operations.py | 9 +- .../_restore_point_collections_operations.py | 31 +-- .../operations/_restore_points_operations.py | 21 +- .../_shared_galleries_operations.py | 13 +- ...hared_gallery_image_versions_operations.py | 13 +- .../_shared_gallery_images_operations.py | 13 +- .../operations/_ssh_public_keys_operations.py | 33 ++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- ...ual_machine_images_edge_zone_operations.py | 25 ++- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 39 ++-- ...machine_scale_set_extensions_operations.py | 31 +-- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...hine_scale_set_vm_extensions_operations.py | 31 +-- ...ne_scale_set_vm_run_commands_operations.py | 31 +-- ...irtual_machine_scale_set_vms_operations.py | 91 ++++----- .../_virtual_machine_scale_sets_operations.py | 125 ++++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 137 +++++++------- .../mgmt/compute/v2021_08_01/__init__.py | 4 +- .../compute/v2021_08_01/_configuration.py | 8 +- .../mgmt/compute/v2021_08_01/_metadata.json | 2 +- .../mgmt/compute/v2021_08_01/_version.py | 2 +- .../mgmt/compute/v2021_08_01/aio/__init__.py | 4 +- .../compute/v2021_08_01/aio/_configuration.py | 8 +- .../operations/_disk_accesses_operations.py | 37 ++-- .../_disk_encryption_sets_operations.py | 25 ++- .../_disk_restore_point_operations.py | 17 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_snapshots_operations.py | 31 +-- .../operations/_disk_accesses_operations.py | 59 +++--- .../_disk_encryption_sets_operations.py | 39 ++-- .../_disk_restore_point_operations.py | 25 ++- .../operations/_disks_operations.py | 47 +++-- .../operations/_snapshots_operations.py | 47 +++-- .../mgmt/compute/v2021_10_01/__init__.py | 4 +- .../compute/v2021_10_01/_configuration.py | 8 +- .../mgmt/compute/v2021_10_01/_metadata.json | 2 +- .../mgmt/compute/v2021_10_01/_version.py | 2 +- .../mgmt/compute/v2021_10_01/aio/__init__.py | 4 +- .../compute/v2021_10_01/aio/_configuration.py | 8 +- .../aio/operations/_galleries_operations.py | 23 ++- ...gallery_application_versions_operations.py | 21 +- .../_gallery_applications_operations.py | 21 +- .../_gallery_image_versions_operations.py | 21 +- .../operations/_gallery_images_operations.py | 21 +- .../_gallery_sharing_profile_operations.py | 9 +- .../operations/_galleries_operations.py | 35 ++-- ...gallery_application_versions_operations.py | 31 +-- .../_gallery_applications_operations.py | 31 +-- .../_gallery_image_versions_operations.py | 31 +-- .../operations/_gallery_images_operations.py | 31 +-- .../_gallery_sharing_profile_operations.py | 11 +- .../mgmt/compute/v2021_11_01/__init__.py | 4 +- .../compute/v2021_11_01/_configuration.py | 8 +- .../mgmt/compute/v2021_11_01/_metadata.json | 2 +- .../mgmt/compute/v2021_11_01/_version.py | 2 +- .../mgmt/compute/v2021_11_01/aio/__init__.py | 4 +- .../compute/v2021_11_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- ..._capacity_reservation_groups_operations.py | 17 +- .../_capacity_reservations_operations.py | 21 +- .../_dedicated_host_groups_operations.py | 17 +- .../operations/_dedicated_hosts_operations.py | 25 ++- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2021_11_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../_restore_point_collections_operations.py | 19 +- .../operations/_restore_points_operations.py | 15 +- .../operations/_ssh_public_keys_operations.py | 19 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- ...ual_machine_images_edge_zone_operations.py | 15 +- .../_virtual_machine_images_operations.py | 15 +- ...virtual_machine_run_commands_operations.py | 25 ++- ...machine_scale_set_extensions_operations.py | 21 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...hine_scale_set_vm_extensions_operations.py | 21 +- ...ne_scale_set_vm_run_commands_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 59 +++--- .../_virtual_machine_scale_sets_operations.py | 79 ++++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 87 +++++---- .../compute/v2021_11_01/models/_models_py3.py | 15 +- .../_availability_sets_operations.py | 33 ++-- ..._capacity_reservation_groups_operations.py | 29 +-- .../_capacity_reservations_operations.py | 31 +-- .../_dedicated_host_groups_operations.py | 29 +-- .../operations/_dedicated_hosts_operations.py | 37 ++-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2021_11_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../_restore_point_collections_operations.py | 31 +-- .../operations/_restore_points_operations.py | 21 +- .../operations/_ssh_public_keys_operations.py | 33 ++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- ...ual_machine_images_edge_zone_operations.py | 25 ++- .../_virtual_machine_images_operations.py | 25 ++- ...virtual_machine_run_commands_operations.py | 39 ++-- ...machine_scale_set_extensions_operations.py | 31 +-- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...hine_scale_set_vm_extensions_operations.py | 31 +-- ...ne_scale_set_vm_run_commands_operations.py | 31 +-- ...irtual_machine_scale_set_vms_operations.py | 91 ++++----- .../_virtual_machine_scale_sets_operations.py | 125 ++++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 137 +++++++------- .../mgmt/compute/v2021_12_01/__init__.py | 4 +- .../compute/v2021_12_01/_configuration.py | 8 +- .../mgmt/compute/v2021_12_01/_metadata.json | 2 +- .../mgmt/compute/v2021_12_01/_version.py | 2 +- .../mgmt/compute/v2021_12_01/aio/__init__.py | 4 +- .../compute/v2021_12_01/aio/_configuration.py | 8 +- .../operations/_disk_accesses_operations.py | 37 ++-- .../_disk_encryption_sets_operations.py | 25 ++- .../_disk_restore_point_operations.py | 17 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_snapshots_operations.py | 31 +-- .../operations/_disk_accesses_operations.py | 59 +++--- .../_disk_encryption_sets_operations.py | 39 ++-- .../_disk_restore_point_operations.py | 25 ++- .../operations/_disks_operations.py | 47 +++-- .../operations/_snapshots_operations.py | 47 +++-- .../mgmt/compute/v2022_01_03/__init__.py | 4 +- .../compute/v2022_01_03/_configuration.py | 8 +- .../mgmt/compute/v2022_01_03/_metadata.json | 2 +- .../mgmt/compute/v2022_01_03/_version.py | 2 +- .../mgmt/compute/v2022_01_03/aio/__init__.py | 4 +- .../compute/v2022_01_03/aio/_configuration.py | 8 +- .../_community_galleries_operations.py | 7 +- ...unity_gallery_image_versions_operations.py | 9 +- .../_community_gallery_images_operations.py | 9 +- .../aio/operations/_galleries_operations.py | 23 ++- ...gallery_application_versions_operations.py | 21 +- .../_gallery_applications_operations.py | 21 +- .../_gallery_image_versions_operations.py | 21 +- .../operations/_gallery_images_operations.py | 21 +- .../_gallery_sharing_profile_operations.py | 9 +- .../_shared_galleries_operations.py | 9 +- ...hared_gallery_image_versions_operations.py | 9 +- .../_shared_gallery_images_operations.py | 9 +- .../_community_galleries_operations.py | 9 +- ...unity_gallery_image_versions_operations.py | 13 +- .../_community_gallery_images_operations.py | 13 +- .../operations/_galleries_operations.py | 35 ++-- ...gallery_application_versions_operations.py | 31 +-- .../_gallery_applications_operations.py | 31 +-- .../_gallery_image_versions_operations.py | 31 +-- .../operations/_gallery_images_operations.py | 31 +-- .../_gallery_sharing_profile_operations.py | 11 +- .../_shared_galleries_operations.py | 13 +- ...hared_gallery_image_versions_operations.py | 13 +- .../_shared_gallery_images_operations.py | 13 +- .../mgmt/compute/v2022_03_01/__init__.py | 4 +- .../compute/v2022_03_01/_configuration.py | 8 +- .../mgmt/compute/v2022_03_01/_metadata.json | 2 +- .../mgmt/compute/v2022_03_01/_version.py | 2 +- .../mgmt/compute/v2022_03_01/aio/__init__.py | 4 +- .../compute/v2022_03_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- ..._capacity_reservation_groups_operations.py | 17 +- .../_capacity_reservations_operations.py | 21 +- .../_dedicated_host_groups_operations.py | 17 +- .../operations/_dedicated_hosts_operations.py | 25 ++- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2022_03_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../_restore_point_collections_operations.py | 19 +- .../operations/_restore_points_operations.py | 15 +- .../operations/_ssh_public_keys_operations.py | 19 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- ...ual_machine_images_edge_zone_operations.py | 15 +- .../_virtual_machine_images_operations.py | 17 +- ...virtual_machine_run_commands_operations.py | 25 ++- ...machine_scale_set_extensions_operations.py | 21 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...hine_scale_set_vm_extensions_operations.py | 21 +- ...ne_scale_set_vm_run_commands_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 59 +++--- .../_virtual_machine_scale_sets_operations.py | 79 ++++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 87 +++++---- .../compute/v2022_03_01/models/_models_py3.py | 93 ++++++--- .../_availability_sets_operations.py | 33 ++-- ..._capacity_reservation_groups_operations.py | 29 +-- .../_capacity_reservations_operations.py | 31 +-- .../_dedicated_host_groups_operations.py | 29 +-- .../operations/_dedicated_hosts_operations.py | 37 ++-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2022_03_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../_restore_point_collections_operations.py | 31 +-- .../operations/_restore_points_operations.py | 21 +- .../operations/_ssh_public_keys_operations.py | 33 ++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- ...ual_machine_images_edge_zone_operations.py | 25 ++- .../_virtual_machine_images_operations.py | 29 +-- ...virtual_machine_run_commands_operations.py | 39 ++-- ...machine_scale_set_extensions_operations.py | 31 +-- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...hine_scale_set_vm_extensions_operations.py | 31 +-- ...ne_scale_set_vm_run_commands_operations.py | 31 +-- ...irtual_machine_scale_set_vms_operations.py | 91 ++++----- .../_virtual_machine_scale_sets_operations.py | 125 ++++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 137 +++++++------- .../mgmt/compute/v2022_03_02/__init__.py | 4 +- .../compute/v2022_03_02/_configuration.py | 8 +- .../mgmt/compute/v2022_03_02/_metadata.json | 2 +- .../mgmt/compute/v2022_03_02/_version.py | 2 +- .../mgmt/compute/v2022_03_02/aio/__init__.py | 4 +- .../compute/v2022_03_02/aio/_configuration.py | 8 +- .../operations/_disk_accesses_operations.py | 37 ++-- .../_disk_encryption_sets_operations.py | 25 ++- .../_disk_restore_point_operations.py | 17 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_snapshots_operations.py | 31 +-- .../operations/_disk_accesses_operations.py | 59 +++--- .../_disk_encryption_sets_operations.py | 39 ++-- .../_disk_restore_point_operations.py | 25 ++- .../operations/_disks_operations.py | 47 +++-- .../operations/_snapshots_operations.py | 47 +++-- .../mgmt/compute/v2022_03_03/__init__.py | 4 +- .../compute/v2022_03_03/_configuration.py | 8 +- .../mgmt/compute/v2022_03_03/_metadata.json | 2 +- .../mgmt/compute/v2022_03_03/_version.py | 2 +- .../mgmt/compute/v2022_03_03/aio/__init__.py | 4 +- .../compute/v2022_03_03/aio/_configuration.py | 8 +- .../_community_galleries_operations.py | 7 +- ...unity_gallery_image_versions_operations.py | 9 +- .../_community_gallery_images_operations.py | 9 +- .../aio/operations/_galleries_operations.py | 23 ++- ...gallery_application_versions_operations.py | 21 +- .../_gallery_applications_operations.py | 21 +- .../_gallery_image_versions_operations.py | 21 +- .../operations/_gallery_images_operations.py | 21 +- .../_gallery_sharing_profile_operations.py | 9 +- .../_shared_galleries_operations.py | 9 +- ...hared_gallery_image_versions_operations.py | 9 +- .../_shared_gallery_images_operations.py | 9 +- .../compute/v2022_03_03/models/__init__.py | 14 ++ .../_compute_management_client_enums.py | 6 + .../compute/v2022_03_03/models/_models_py3.py | 179 ++++++++++++++++++ .../_community_galleries_operations.py | 9 +- ...unity_gallery_image_versions_operations.py | 13 +- .../_community_gallery_images_operations.py | 13 +- .../operations/_galleries_operations.py | 35 ++-- ...gallery_application_versions_operations.py | 31 +-- .../_gallery_applications_operations.py | 31 +-- .../_gallery_image_versions_operations.py | 31 +-- .../operations/_gallery_images_operations.py | 31 +-- .../_gallery_sharing_profile_operations.py | 11 +- .../_shared_galleries_operations.py | 13 +- ...hared_gallery_image_versions_operations.py | 13 +- .../_shared_gallery_images_operations.py | 13 +- .../mgmt/compute/v2022_04_04/__init__.py | 4 +- .../compute/v2022_04_04/_configuration.py | 8 +- .../mgmt/compute/v2022_04_04/_metadata.json | 2 +- .../mgmt/compute/v2022_04_04/_version.py | 2 +- .../mgmt/compute/v2022_04_04/aio/__init__.py | 4 +- .../compute/v2022_04_04/aio/_configuration.py | 8 +- ...ud_service_operating_systems_operations.py | 13 +- ...cloud_service_role_instances_operations.py | 29 +-- .../_cloud_service_roles_operations.py | 9 +- .../operations/_cloud_services_operations.py | 49 ++--- ...cloud_services_update_domain_operations.py | 13 +- .../compute/v2022_04_04/models/_models_py3.py | 7 +- ...ud_service_operating_systems_operations.py | 21 +- ...cloud_service_role_instances_operations.py | 45 +++-- .../_cloud_service_roles_operations.py | 13 +- .../operations/_cloud_services_operations.py | 75 ++++---- ...cloud_services_update_domain_operations.py | 19 +- .../mgmt/compute/v2022_07_02/__init__.py | 4 +- .../compute/v2022_07_02/_configuration.py | 8 +- .../mgmt/compute/v2022_07_02/_metadata.json | 2 +- .../mgmt/compute/v2022_07_02/_version.py | 2 +- .../mgmt/compute/v2022_07_02/aio/__init__.py | 4 +- .../compute/v2022_07_02/aio/_configuration.py | 8 +- .../operations/_disk_accesses_operations.py | 37 ++-- .../_disk_encryption_sets_operations.py | 25 ++- .../_disk_restore_point_operations.py | 17 +- .../aio/operations/_disks_operations.py | 31 +-- .../aio/operations/_snapshots_operations.py | 31 +-- .../compute/v2022_07_02/models/__init__.py | 2 + .../compute/v2022_07_02/models/_models_py3.py | 30 +++ .../operations/_disk_accesses_operations.py | 59 +++--- .../_disk_encryption_sets_operations.py | 39 ++-- .../_disk_restore_point_operations.py | 25 ++- .../operations/_disks_operations.py | 47 +++-- .../operations/_snapshots_operations.py | 47 +++-- .../mgmt/compute/v2022_08_01/__init__.py | 4 +- .../compute/v2022_08_01/_configuration.py | 8 +- .../mgmt/compute/v2022_08_01/_metadata.json | 2 +- .../mgmt/compute/v2022_08_01/_version.py | 2 +- .../mgmt/compute/v2022_08_01/aio/__init__.py | 4 +- .../compute/v2022_08_01/aio/_configuration.py | 8 +- .../_availability_sets_operations.py | 19 +- ..._capacity_reservation_groups_operations.py | 17 +- .../_capacity_reservations_operations.py | 21 +- .../_dedicated_host_groups_operations.py | 17 +- .../operations/_dedicated_hosts_operations.py | 25 ++- .../aio/operations/_images_operations.py | 23 ++- .../operations/_log_analytics_operations.py | 13 +- .../v2022_08_01/aio/operations/_operations.py | 7 +- .../_proximity_placement_groups_operations.py | 17 +- .../_restore_point_collections_operations.py | 19 +- .../operations/_restore_points_operations.py | 15 +- .../operations/_ssh_public_keys_operations.py | 19 +- .../aio/operations/_usage_operations.py | 7 +- ...ual_machine_extension_images_operations.py | 11 +- .../_virtual_machine_extensions_operations.py | 21 +- ...ual_machine_images_edge_zone_operations.py | 15 +- .../_virtual_machine_images_operations.py | 17 +- ...virtual_machine_run_commands_operations.py | 25 ++- ...machine_scale_set_extensions_operations.py | 21 +- ...e_scale_set_rolling_upgrades_operations.py | 19 +- ...hine_scale_set_vm_extensions_operations.py | 21 +- ...ne_scale_set_vm_run_commands_operations.py | 21 +- ...irtual_machine_scale_set_vms_operations.py | 59 +++--- .../_virtual_machine_scale_sets_operations.py | 79 ++++---- .../_virtual_machine_sizes_operations.py | 7 +- .../_virtual_machines_operations.py | 87 +++++---- .../compute/v2022_08_01/models/__init__.py | 2 + .../compute/v2022_08_01/models/_models_py3.py | 45 ++++- .../_availability_sets_operations.py | 33 ++-- ..._capacity_reservation_groups_operations.py | 29 +-- .../_capacity_reservations_operations.py | 31 +-- .../_dedicated_host_groups_operations.py | 29 +-- .../operations/_dedicated_hosts_operations.py | 37 ++-- .../operations/_images_operations.py | 35 ++-- .../operations/_log_analytics_operations.py | 17 +- .../v2022_08_01/operations/_operations.py | 9 +- .../_proximity_placement_groups_operations.py | 29 +-- .../_restore_point_collections_operations.py | 31 +-- .../operations/_restore_points_operations.py | 21 +- .../operations/_ssh_public_keys_operations.py | 33 ++-- .../operations/_usage_operations.py | 9 +- ...ual_machine_extension_images_operations.py | 17 +- .../_virtual_machine_extensions_operations.py | 31 +-- ...ual_machine_images_edge_zone_operations.py | 25 ++- .../_virtual_machine_images_operations.py | 29 +-- ...virtual_machine_run_commands_operations.py | 39 ++-- ...machine_scale_set_extensions_operations.py | 31 +-- ...e_scale_set_rolling_upgrades_operations.py | 27 +-- ...hine_scale_set_vm_extensions_operations.py | 31 +-- ...ne_scale_set_vm_run_commands_operations.py | 31 +-- ...irtual_machine_scale_set_vms_operations.py | 91 ++++----- .../_virtual_machine_scale_sets_operations.py | 125 ++++++------ .../_virtual_machine_sizes_operations.py | 9 +- .../_virtual_machines_operations.py | 137 +++++++------- 1249 files changed, 19745 insertions(+), 12775 deletions(-) diff --git a/sdk/compute/azure-mgmt-compute/_meta.json b/sdk/compute/azure-mgmt-compute/_meta.json index b932f2acec7d..79630046e465 100644 --- a/sdk/compute/azure-mgmt-compute/_meta.json +++ b/sdk/compute/azure-mgmt-compute/_meta.json @@ -1,11 +1,11 @@ { + "commit": "e98542789965b2d8f124e7b4c6bad5b17f5f635e", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.1.11", + "@autorest/python@6.2.1", "@autorest/modelerfour@4.24.3" ], - "commit": "3cc85e694a07ba8ea5d0f21cefef71205dc3846e", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/compute/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.1.11 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/compute/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.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/compute/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py index dc23198d774c..07ae3e5b2078 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2015-06-15") # type: str + api_version = kwargs.pop("api_version", "2015-06-15") # type: Literal["2015-06-15"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json index 63ad4ca3d36e..1d0760131ce5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json @@ -107,4 +107,4 @@ "virtual_machine_scale_sets": "VirtualMachineScaleSetsOperations", "virtual_machine_scale_set_vms": "VirtualMachineScaleSetVMsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py index 566ac3f293a4..3c8c2675ca27 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2015-06-15") # type: str + api_version = kwargs.pop("api_version", "2015-06-15") # type: Literal["2015-06-15"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py index 5a65b9881106..77749c00404c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -36,6 +37,10 @@ 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]] @@ -145,7 +150,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -217,7 +222,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -277,7 +282,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -326,7 +331,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -414,7 +419,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py index 295b15f53ed8..7435d1550b13 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py index 2cd6c8f3d1ca..e3ccad03820e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py index d509149aaef3..530d74ac6121 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -251,7 +256,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -486,7 +491,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -544,7 +549,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -611,7 +616,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -687,7 +692,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py index bb0155804561..b3a5eeea81dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py index 1dbfbeb92791..8a0d1707eacc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -42,6 +43,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -145,7 +150,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -203,7 +208,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -271,7 +276,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -329,7 +334,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -395,7 +400,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -464,7 +469,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -527,7 +532,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -598,7 +603,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -684,7 +689,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -752,7 +757,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -810,7 +815,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -876,7 +881,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -934,7 +939,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1000,7 +1005,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py index 01cf391f8e43..6ae4446bc98d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_instances_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -238,7 +243,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -295,7 +300,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -358,7 +363,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -424,7 +429,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -476,7 +481,7 @@ async def _deallocate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -646,7 +651,7 @@ async def begin_deallocate( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -710,7 +715,7 @@ async def _delete_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -871,7 +876,7 @@ async def begin_delete_instances( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -943,7 +948,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -993,7 +998,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1077,7 +1082,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1165,7 +1170,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1252,7 +1257,7 @@ async def _power_off_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1422,7 +1427,7 @@ async def begin_power_off( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1486,7 +1491,7 @@ async def _restart_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1650,7 +1655,7 @@ async def begin_restart( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1714,7 +1719,7 @@ async def _start_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1878,7 +1883,7 @@ async def begin_start( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1942,7 +1947,7 @@ async def _update_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2103,7 +2108,7 @@ async def begin_update_instances( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2163,7 +2168,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2226,7 +2231,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py index d9922e7074a3..dd331b763a14 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py index ae7e77462712..e2dfb4a23278 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,6 +47,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -247,7 +252,7 @@ async def begin_capture( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -307,7 +312,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -462,7 +467,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -519,7 +524,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -582,7 +587,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -624,7 +629,7 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -651,7 +656,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -700,7 +705,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -764,7 +769,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -833,7 +838,7 @@ async def generalize( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -883,7 +888,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -965,7 +970,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1052,7 +1057,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1135,7 +1140,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1199,7 +1204,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1256,7 +1261,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1319,7 +1324,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1376,7 +1381,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1496,7 +1501,7 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1559,7 +1564,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_models_py3.py index 6aa72523a17e..f350b1dc2b2b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -52,8 +57,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py index 9b29763ae5fb..026c05754ff0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,7 @@ def build_list_available_sizes_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -296,7 +301,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -368,7 +373,7 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -428,7 +433,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -476,7 +481,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -563,7 +568,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py index c023c749cd60..36a74cefc842 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py index 17b488d87309..aa7a999f44d1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py index 01f5a095a2bf..39c7694ec6ab 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -391,7 +396,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -454,7 +459,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -626,7 +631,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -684,7 +689,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -751,7 +756,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -827,7 +832,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py index 8d6b6ec61ead..d3e9b1eef616 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py index c656163468db..1f70f6896206 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_deallocate_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +113,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_get_instance_view_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -211,7 +216,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +255,7 @@ def build_power_off_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +287,7 @@ def build_restart_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -314,7 +319,7 @@ def build_start_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +378,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -439,7 +444,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -496,7 +501,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -564,7 +569,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -621,7 +626,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -687,7 +692,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -756,7 +761,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -819,7 +824,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -890,7 +895,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -976,7 +981,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1044,7 +1049,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1101,7 +1106,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1167,7 +1172,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1224,7 +1229,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1290,7 +1295,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py index 871295f99a3e..74752c9c270c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +114,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_deallocate_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_instances_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -208,7 +213,7 @@ def build_get_instance_view_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +270,7 @@ def build_list_all_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,7 +298,7 @@ def build_list_skus_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +329,7 @@ def build_power_off_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -358,7 +363,7 @@ def build_restart_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -392,7 +397,7 @@ def build_start_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -426,7 +431,7 @@ def build_update_instances_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -460,7 +465,7 @@ def build_reimage_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -518,7 +523,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -672,7 +677,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -729,7 +734,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -792,7 +797,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -856,7 +861,7 @@ def get(self, resource_group_name: str, vm_scale_set_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -908,7 +913,7 @@ def _deallocate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1078,7 +1083,7 @@ def begin_deallocate( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1141,7 +1146,7 @@ def _delete_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1302,7 +1307,7 @@ def begin_delete_instances( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1373,7 +1378,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1423,7 +1428,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1507,7 +1512,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1595,7 +1600,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1682,7 +1687,7 @@ def _power_off_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1852,7 +1857,7 @@ def begin_power_off( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1915,7 +1920,7 @@ def _restart_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2079,7 +2084,7 @@ def begin_restart( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2142,7 +2147,7 @@ def _start_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2306,7 +2311,7 @@ def begin_start( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2369,7 +2374,7 @@ def _update_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2530,7 +2535,7 @@ def begin_update_instances( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2589,7 +2594,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2652,7 +2657,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py index 3763f1da6ce2..23459b0644e5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py index 92e0d8a7b0e9..29fe70742d2d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_delete_request(resource_group_name: str, vm_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,12 +139,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +182,7 @@ def build_deallocate_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +213,7 @@ def build_generalize_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -232,7 +242,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +270,7 @@ def build_list_all_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -286,7 +296,7 @@ def build_list_available_sizes_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +325,7 @@ def build_power_off_request(resource_group_name: str, vm_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -344,7 +354,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +383,7 @@ def build_start_request(resource_group_name: str, vm_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", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -402,7 +412,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -464,7 +474,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -624,7 +634,7 @@ def begin_capture( _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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -683,7 +693,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -835,7 +845,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -892,7 +902,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -955,7 +965,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -997,7 +1007,7 @@ def get_long_running_output(pipeline_response): @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1024,7 +1034,7 @@ 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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1073,7 +1083,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1137,7 +1147,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1203,7 +1213,7 @@ def generalize(self, resource_group_name: str, vm_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", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1252,7 +1262,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1333,7 +1343,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1419,7 +1429,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1502,7 +1512,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1566,7 +1576,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1622,7 +1632,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1685,7 +1695,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1741,7 +1751,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1804,7 +1814,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1860,7 +1870,7 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1923,7 +1933,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py index d6ba988acaac..ea01eb6d6c12 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2016-03-30") # type: str + api_version = kwargs.pop("api_version", "2016-03-30") # type: Literal["2016-03-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json index 300665ff9dba..4af9ae118ddf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json @@ -107,4 +107,4 @@ "virtual_machine_scale_sets": "VirtualMachineScaleSetsOperations", "virtual_machine_scale_set_vms": "VirtualMachineScaleSetVMsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py index 4c1fdb009898..3ad15b35fcb8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2016-03-30") # type: str + api_version = kwargs.pop("api_version", "2016-03-30") # type: Literal["2016-03-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py index 9f57931762e6..2268eaedab52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ 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]] @@ -146,7 +151,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -218,7 +223,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -278,7 +283,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -330,7 +335,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -413,7 +418,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -501,7 +506,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py index 242115da34b0..29b2ce410c0a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py index 4fae9c145f72..eefdd2e4741b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py index 2b7f26cf6647..7d35f6d3e293 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -251,7 +256,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -486,7 +491,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -544,7 +549,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -611,7 +616,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -687,7 +692,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py index f4ca301b849e..61cfbc790033 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py index fdc4198ef4e4..13cede2497b2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -42,6 +43,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -145,7 +150,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -203,7 +208,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -271,7 +276,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -329,7 +334,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -395,7 +400,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -464,7 +469,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -527,7 +532,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -598,7 +603,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -684,7 +689,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -752,7 +757,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -810,7 +815,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -876,7 +881,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -934,7 +939,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1000,7 +1005,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py index a15e597c04f0..c93ff7f40242 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_instances_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -238,7 +243,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -295,7 +300,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -358,7 +363,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -424,7 +429,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -476,7 +481,7 @@ async def _deallocate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -646,7 +651,7 @@ async def begin_deallocate( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -710,7 +715,7 @@ async def _delete_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -871,7 +876,7 @@ async def begin_delete_instances( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -943,7 +948,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -993,7 +998,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1077,7 +1082,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1165,7 +1170,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1252,7 +1257,7 @@ async def _power_off_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1422,7 +1427,7 @@ async def begin_power_off( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1486,7 +1491,7 @@ async def _restart_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1650,7 +1655,7 @@ async def begin_restart( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1714,7 +1719,7 @@ async def _start_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1878,7 +1883,7 @@ async def begin_start( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1942,7 +1947,7 @@ async def _update_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2103,7 +2108,7 @@ async def begin_update_instances( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2163,7 +2168,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2226,7 +2231,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py index 4a90ab9be5ef..6f6ce12e0df5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py index 389d2de42895..91eb62934660 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ async def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -151,7 +156,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -311,7 +316,7 @@ async def begin_capture( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -371,7 +376,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -526,7 +531,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -583,7 +588,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -646,7 +651,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -715,7 +720,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -764,7 +769,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -828,7 +833,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ async def generalize( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -947,7 +952,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1029,7 +1034,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1116,7 +1121,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1199,7 +1204,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1263,7 +1268,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1320,7 +1325,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1383,7 +1388,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1440,7 +1445,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1503,7 +1508,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1560,7 +1565,7 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1623,7 +1628,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models_py3.py index 4f9b95dd7426..4854ffb1eab3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -52,8 +57,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs @@ -2590,7 +2595,7 @@ class VirtualMachineIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is @@ -3081,7 +3086,7 @@ class VirtualMachineScaleSetIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine scale set. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py index 117744c7a4d8..c284c1a159b1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +143,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +199,7 @@ def build_list_available_sizes_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +329,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -396,7 +401,7 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -505,7 +510,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -587,7 +592,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -674,7 +679,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py index 958f999486b9..3ae5e6a5c21a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py index 0cf794554e49..58f0efcfe0df 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py index 286b04245650..94f6f40baeef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -391,7 +396,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -454,7 +459,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -626,7 +631,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -684,7 +689,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -751,7 +756,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -827,7 +832,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py index 3b5f3234a7e7..d783202b7607 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py index 353b819309e8..628696b8567a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_deallocate_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +113,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,7 @@ def build_get_instance_view_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -211,7 +216,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +255,7 @@ def build_power_off_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +287,7 @@ def build_restart_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -314,7 +319,7 @@ def build_start_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -373,7 +378,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -439,7 +444,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -496,7 +501,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -564,7 +569,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -621,7 +626,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -687,7 +692,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -756,7 +761,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -819,7 +824,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -890,7 +895,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -976,7 +981,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1044,7 +1049,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1101,7 +1106,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1167,7 +1172,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1224,7 +1229,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1290,7 +1295,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py index 6f10c68604f0..6cf24d85c1fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +114,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_deallocate_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_instances_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -208,7 +213,7 @@ def build_get_instance_view_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +270,7 @@ def build_list_all_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,7 +298,7 @@ def build_list_skus_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +329,7 @@ def build_power_off_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -358,7 +363,7 @@ def build_restart_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -392,7 +397,7 @@ def build_start_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -426,7 +431,7 @@ def build_update_instances_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -460,7 +465,7 @@ def build_reimage_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -518,7 +523,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -672,7 +677,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -729,7 +734,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -792,7 +797,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -856,7 +861,7 @@ def get(self, resource_group_name: str, vm_scale_set_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -908,7 +913,7 @@ def _deallocate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1078,7 +1083,7 @@ def begin_deallocate( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1141,7 +1146,7 @@ def _delete_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1302,7 +1307,7 @@ def begin_delete_instances( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1373,7 +1378,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1423,7 +1428,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1507,7 +1512,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1595,7 +1600,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1682,7 +1687,7 @@ def _power_off_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1852,7 +1857,7 @@ def begin_power_off( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1915,7 +1920,7 @@ def _restart_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2079,7 +2084,7 @@ def begin_restart( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2142,7 +2147,7 @@ def _start_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2306,7 +2311,7 @@ def begin_start( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2369,7 +2374,7 @@ def _update_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2530,7 +2535,7 @@ def begin_update_instances( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2589,7 +2594,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2652,7 +2657,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py index 85bea9b2f5d9..7c9eacb1c406 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py index c3cebe267623..a7afb8f89374 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_get_extensions_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -141,7 +146,7 @@ def build_delete_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,12 +172,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +215,7 @@ def build_deallocate_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -236,7 +246,7 @@ def build_generalize_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +275,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,7 +303,7 @@ def build_list_all_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +329,7 @@ def build_list_available_sizes_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +358,7 @@ def build_power_off_request(resource_group_name: str, vm_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -377,7 +387,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -406,7 +416,7 @@ def build_start_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -435,7 +445,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -507,7 +517,7 @@ def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -560,7 +570,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -720,7 +730,7 @@ def begin_capture( _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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -779,7 +789,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -931,7 +941,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -988,7 +998,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1051,7 +1061,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1093,7 +1103,7 @@ def get_long_running_output(pipeline_response): @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1120,7 +1130,7 @@ 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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1169,7 +1179,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1233,7 +1243,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1299,7 +1309,7 @@ def generalize(self, resource_group_name: str, vm_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", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1348,7 +1358,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1429,7 +1439,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1515,7 +1525,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1598,7 +1608,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1662,7 +1672,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1718,7 +1728,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1781,7 +1791,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1837,7 +1847,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1900,7 +1910,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1956,7 +1966,7 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -2019,7 +2029,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-03-30")) # type: Literal["2016-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py index fe7665f23cfe..0750c30fe49c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2016-04-30-preview") # type: str + api_version = kwargs.pop("api_version", "2016-04-30-preview") # type: Literal["2016-04-30-preview"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json index 8ccb750e9a25..8eb2b52a1cc8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json @@ -110,4 +110,4 @@ "disks": "DisksOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py index c0f4ee644cc1..2e6566798994 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2016-04-30-preview") # type: str + api_version = kwargs.pop("api_version", "2016-04-30-preview") # type: Literal["2016-04-30-preview"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py index 58e959253e9b..141b05309d45 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ 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]] @@ -146,7 +151,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -218,7 +225,9 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -278,7 +287,9 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -325,7 +336,9 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Availabi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -407,7 +420,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -495,7 +510,9 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py index 5f6e9ef9ba39..f1ecf4dc76ea 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +240,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +299,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +456,9 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +527,9 @@ async def get(self, resource_group_name: str, disk_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +577,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -627,7 +644,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -682,7 +701,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -763,7 +784,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -848,7 +871,9 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1013,7 +1038,9 @@ async def begin_grant_access( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1070,7 +1097,9 @@ async def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1135,7 +1164,9 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py index e7659ba6c9f3..b77882a5e250 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ 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]] @@ -75,7 +80,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -227,7 +234,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -284,7 +293,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -347,7 +358,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -415,7 +428,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -465,7 +480,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -547,7 +564,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py index 3b27b6cf001f..5291d37b31d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +243,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +302,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +464,9 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -521,7 +534,9 @@ async def get(self, resource_group_name: str, snapshot_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -569,7 +584,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -633,7 +650,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +707,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -769,7 +790,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -854,7 +877,9 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1016,7 +1041,9 @@ async def begin_grant_access( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1073,7 +1100,9 @@ async def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1137,7 +1166,9 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py index e0317065f14e..45ee4e36d082 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,9 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py index 10173df391da..aa72da3e6766 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +153,9 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +230,9 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py index a7127c4cd529..530d06752686 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +259,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +324,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +498,9 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +558,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -612,7 +627,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +705,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py index fae6ac7bfb7a..e526a15f46f5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +177,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +244,9 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +302,9 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +365,9 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py index 5d66f483f056..e1040a75634b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -43,6 +44,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,9 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -146,7 +153,9 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -204,7 +213,9 @@ async def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -271,7 +282,9 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -329,7 +342,9 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -397,7 +412,9 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -455,7 +472,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -521,7 +540,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -590,7 +611,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -653,7 +676,9 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -720,7 +745,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -806,7 +833,9 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -874,7 +903,9 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -932,7 +963,9 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -998,7 +1031,9 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1056,7 +1091,9 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1122,7 +1159,9 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py index a9992ff875f0..f4bbe3c5b08b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -48,6 +49,10 @@ build_update_instances_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -239,7 +246,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +305,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -359,7 +370,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -425,7 +438,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -477,7 +492,9 @@ async def _deallocate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -647,7 +664,9 @@ async def begin_deallocate( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -711,7 +730,9 @@ async def _delete_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -873,7 +894,9 @@ async def begin_delete_instances( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -945,7 +968,9 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -995,7 +1020,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1079,7 +1106,9 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1167,7 +1196,9 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1254,7 +1285,9 @@ async def _power_off_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1424,7 +1457,9 @@ async def begin_power_off( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1488,7 +1523,9 @@ async def _restart_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1652,7 +1689,9 @@ async def begin_restart( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1716,7 +1755,9 @@ async def _start_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1880,7 +1921,9 @@ async def begin_start( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1944,7 +1987,9 @@ async def _update_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2106,7 +2151,9 @@ async def begin_update_instances( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2166,7 +2213,9 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2229,7 +2278,9 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2286,7 +2337,9 @@ async def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -2350,7 +2403,9 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py index 354db5619177..a8f64d45aa0b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_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]] @@ -67,7 +72,9 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py index ccbb5726116c..c4a4d9529dce 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -48,6 +49,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -99,7 +104,9 @@ async def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -152,7 +159,9 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -314,7 +323,9 @@ async def begin_capture( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -374,7 +385,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -529,7 +542,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -586,7 +601,9 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -649,7 +666,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -691,7 +710,7 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -718,7 +737,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -767,7 +788,9 @@ async def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -831,7 +854,9 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -888,7 +913,9 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -952,7 +979,9 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1021,7 +1050,9 @@ async def generalize( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1071,7 +1102,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1153,7 +1186,9 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1240,7 +1275,9 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1323,7 +1360,9 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1387,7 +1426,9 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1444,7 +1485,9 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1507,7 +1550,9 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1564,7 +1609,9 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1627,7 +1674,9 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1684,7 +1733,9 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1747,7 +1798,9 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_models_py3.py index 2a4309684434..bcfcc2b0be25 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -75,8 +80,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs @@ -3776,7 +3781,7 @@ class VirtualMachineIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is @@ -4386,7 +4391,7 @@ class VirtualMachineScaleSetIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine scale set. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py index 279919f5055d..a7aab6e01a7e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +83,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +116,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +147,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -160,7 +173,9 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,7 +205,9 @@ def build_list_available_sizes_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +337,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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -392,7 +411,9 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -452,7 +473,9 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -499,7 +522,9 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.AvailabilityS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -581,7 +606,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -669,7 +696,9 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py index 57fc92757712..d3f93c9a769e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +83,9 @@ def build_update_request(resource_group_name: str, disk_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +117,9 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,7 +148,9 @@ def build_delete_request(resource_group_name: str, disk_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +179,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +209,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -220,7 +237,9 @@ def build_grant_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -254,7 +273,9 @@ def build_revoke_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +333,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -467,7 +490,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -524,7 +549,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -679,7 +706,9 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -748,7 +777,9 @@ def get(self, resource_group_name: str, disk_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -796,7 +827,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -861,7 +894,9 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -915,7 +950,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -995,7 +1032,9 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1080,7 +1119,9 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1239,7 +1280,9 @@ def begin_grant_access( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1296,7 +1339,9 @@ def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1361,7 +1406,9 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py index 0d26effaad16..4950f226f1f0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +83,9 @@ def build_delete_request(resource_group_name: str, image_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +116,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +149,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +179,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,7 +234,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -368,7 +385,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -425,7 +444,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -488,7 +509,9 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -556,7 +579,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -605,7 +630,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -686,7 +713,9 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py index e9b2b2cb084b..36e207667e63 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +85,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +119,9 @@ def build_get_request(resource_group_name: str, snapshot_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +152,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +183,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +213,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +241,9 @@ def build_grant_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -258,7 +277,9 @@ def build_revoke_access_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -316,7 +337,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -468,7 +491,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +550,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -679,7 +706,9 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -747,7 +776,9 @@ def get(self, resource_group_name: str, snapshot_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -795,7 +826,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -859,7 +892,9 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -913,7 +948,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -993,7 +1030,9 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1078,7 +1117,9 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1234,7 +1275,9 @@ def begin_grant_access( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1291,7 +1334,9 @@ def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1355,7 +1400,9 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py index ef0062145ad2..03a5f7c25a06 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,9 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +104,9 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py index 82dfbd43f509..66839000636b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +78,9 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +119,9 @@ def build_list_versions_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +202,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +266,9 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +343,9 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py index a7f7f93e0383..657a88496ae6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +84,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +121,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +161,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +229,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -392,7 +407,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -455,7 +472,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -627,7 +646,9 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -685,7 +706,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -752,7 +775,9 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -828,7 +853,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py index 501b4fe65dcd..38d209391717 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +90,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +129,9 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +160,9 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +191,9 @@ def build_list_skus_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +270,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +354,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +421,9 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +479,9 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +542,9 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py index ba9cf2d1485c..4009cc270b2a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_reimage_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +83,9 @@ def build_reimage_all_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +117,9 @@ def build_deallocate_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +151,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +185,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +219,9 @@ def build_get_instance_view_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +260,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +301,9 @@ def build_power_off_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -314,7 +335,9 @@ def build_restart_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +369,9 @@ def build_start_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -405,7 +430,9 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -471,7 +498,9 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +557,9 @@ def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -595,7 +626,9 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -652,7 +685,9 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -720,7 +755,9 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -777,7 +814,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -843,7 +882,9 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -912,7 +953,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -975,7 +1018,9 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1042,7 +1087,9 @@ 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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1128,7 +1175,9 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1196,7 +1245,9 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1253,7 +1304,9 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1319,7 +1372,9 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1376,7 +1431,9 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1442,7 +1499,9 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py index 6e46cea37870..dcee9c45c693 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +85,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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +118,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +151,9 @@ def build_deallocate_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +187,9 @@ def build_delete_instances_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -208,7 +223,9 @@ def build_get_instance_view_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +254,9 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +284,9 @@ def build_list_all_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,7 +314,9 @@ def build_list_skus_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +347,9 @@ def build_power_off_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -358,7 +383,9 @@ def build_restart_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -392,7 +419,9 @@ def build_start_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -426,7 +455,9 @@ def build_update_instances_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -460,7 +491,9 @@ def build_reimage_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -491,7 +524,9 @@ def build_reimage_all_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -549,7 +584,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -703,7 +740,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -760,7 +799,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -823,7 +864,9 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -887,7 +930,9 @@ def get(self, resource_group_name: str, vm_scale_set_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -939,7 +984,9 @@ def _deallocate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1109,7 +1156,9 @@ def begin_deallocate( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1172,7 +1221,9 @@ def _delete_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1334,7 +1385,9 @@ def begin_delete_instances( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1405,7 +1458,9 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1455,7 +1510,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1539,7 +1596,9 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1627,7 +1686,9 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1714,7 +1775,9 @@ def _power_off_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1884,7 +1947,9 @@ def begin_power_off( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1947,7 +2012,9 @@ def _restart_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2111,7 +2178,9 @@ def begin_restart( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2174,7 +2243,9 @@ def _start_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2338,7 +2409,9 @@ def begin_start( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2401,7 +2474,9 @@ def _update_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2563,7 +2638,9 @@ def begin_update_instances( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2622,7 +2699,9 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -2685,7 +2764,9 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2741,7 +2822,9 @@ def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -2805,7 +2888,9 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py index eafbef13cae1..5ae5899622e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,9 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +104,9 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py index 32a170dd007a..9c1a2ab7f7db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_get_extensions_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +82,9 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +118,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -141,7 +152,9 @@ def build_delete_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,12 +180,19 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +225,9 @@ def build_convert_to_managed_disks_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -236,7 +258,9 @@ def build_deallocate_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -267,7 +291,9 @@ def build_generalize_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -296,7 +322,9 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +352,9 @@ def build_list_all_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -350,7 +380,9 @@ def build_list_available_sizes_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -379,7 +411,9 @@ def build_power_off_request(resource_group_name: str, vm_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +442,9 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -437,7 +473,9 @@ def build_start_request(resource_group_name: str, vm_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", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -466,7 +504,9 @@ def build_redeploy_request(resource_group_name: str, vm_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -538,7 +578,9 @@ def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -591,7 +633,9 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -753,7 +797,9 @@ def begin_capture( _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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -812,7 +858,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -967,7 +1015,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1024,7 +1074,9 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1087,7 +1139,9 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1129,7 +1183,7 @@ def get_long_running_output(pipeline_response): @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1156,7 +1210,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1205,7 +1261,9 @@ def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -1269,7 +1327,9 @@ def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1325,7 +1385,9 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1389,7 +1451,9 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1455,7 +1519,9 @@ def generalize(self, resource_group_name: str, vm_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", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1505,7 +1571,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1587,7 +1655,9 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1674,7 +1744,9 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1757,7 +1829,9 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1821,7 +1895,9 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1877,7 +1953,9 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1940,7 +2018,9 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1996,7 +2076,9 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -2059,7 +2141,9 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2115,7 +2199,9 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -2178,7 +2264,9 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-04-30-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2016-04-30-preview") + ) # type: Literal["2016-04-30-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py index 6efdc5a84517..1e67f625f4b3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-03-30") # type: str + api_version = kwargs.pop("api_version", "2017-03-30") # type: Literal["2017-03-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json index 5870983489c9..4c7668c89ff4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json @@ -114,4 +114,4 @@ "snapshots": "SnapshotsOperations", "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py index 332b54927e20..7fb8bc91472b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-03-30") # type: str + api_version = kwargs.pop("api_version", "2017-03-30") # type: Literal["2017-03-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py index 8dc7ce2c247c..7aa23101a952 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ 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]] @@ -150,7 +155,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -222,7 +227,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -282,7 +287,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -334,7 +339,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -417,7 +422,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -505,7 +510,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py index 9dc72e309aa6..3ddd98b7d281 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -627,7 +632,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -681,7 +686,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -761,7 +766,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -846,7 +851,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1008,7 +1013,7 @@ async def begin_grant_access( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1130,7 +1135,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py index ba95a5fb5e64..dcc8878e95f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ 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]] @@ -75,7 +80,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -224,7 +229,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -281,7 +286,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -344,7 +349,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -412,7 +417,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -461,7 +466,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -542,7 +547,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py index 75a07f72e7bd..f47fef101562 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._resource_skus_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]] @@ -65,7 +70,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py index 101ff198ce75..c5f6433f4d7e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -635,7 +640,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -690,7 +695,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -771,7 +776,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -856,7 +861,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1018,7 +1023,7 @@ async def begin_grant_access( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1075,7 +1080,7 @@ async def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1140,7 +1145,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py index a9cfa83bec18..0cfcfa208274 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py index da7e38a6a1fa..f925fe961891 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py index 75ae364e9246..f5c6231d1008 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -251,7 +256,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -486,7 +491,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -544,7 +549,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -611,7 +616,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -687,7 +692,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py index b7429de47ed0..7a93f80d75b0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py index c99e4b2b107f..517d1cbe3744 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, 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]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py index faf8e4b18b5e..7d08f823fb5f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ 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]] @@ -79,7 +84,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -380,7 +385,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -456,7 +461,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -512,7 +517,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index d985f2be77a0..10ae64d2541b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_start_os_upgrade_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]] @@ -70,7 +75,7 @@ async def _cancel_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_cancel_request( @@ -133,7 +138,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -190,7 +195,7 @@ async def _start_os_upgrade_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_os_upgrade_request( @@ -255,7 +260,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -324,7 +329,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py index 890d52b6a8e9..9dc6e4e130cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -43,6 +44,10 @@ build_start_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -146,7 +151,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -204,7 +209,7 @@ async def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -271,7 +276,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -329,7 +334,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -397,7 +402,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -455,7 +460,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -521,7 +526,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -590,7 +595,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -653,7 +658,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -724,7 +729,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -810,7 +815,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -878,7 +883,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -936,7 +941,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1002,7 +1007,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1060,7 +1065,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1126,7 +1131,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py index 21efa0675e58..b69aa0415dfe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -248,7 +253,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -463,7 +468,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -520,7 +525,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -583,7 +588,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -649,7 +654,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -701,7 +706,7 @@ async def _deallocate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -871,7 +876,7 @@ async def begin_deallocate( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -935,7 +940,7 @@ async def _delete_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1096,7 +1101,7 @@ async def begin_delete_instances( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1168,7 +1173,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1218,7 +1223,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1302,7 +1307,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1390,7 +1395,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1477,7 +1482,7 @@ async def _power_off_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1647,7 +1652,7 @@ async def begin_power_off( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1711,7 +1716,7 @@ async def _restart_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1875,7 +1880,7 @@ async def begin_restart( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1939,7 +1944,7 @@ async def _start_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2103,7 +2108,7 @@ async def begin_start( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2167,7 +2172,7 @@ async def _update_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2328,7 +2333,7 @@ async def begin_update_instances( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2392,7 +2397,7 @@ async def _reimage_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2556,7 +2561,7 @@ async def begin_reimage( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2620,7 +2625,7 @@ async def _reimage_all_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2787,7 +2792,7 @@ async def begin_reimage_all( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py index 2ed36ff084df..862351b9c694 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py index ee3f45f46a9a..dc2b7753d0a3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -52,6 +53,10 @@ build_start_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]] @@ -103,7 +108,7 @@ async def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -154,7 +159,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -240,7 +245,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -400,7 +405,7 @@ async def begin_capture( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -460,7 +465,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -615,7 +620,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -672,7 +677,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -735,7 +740,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -777,7 +782,7 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -804,7 +809,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -865,7 +870,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -913,7 +918,7 @@ async def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -977,7 +982,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1034,7 +1039,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1098,7 +1103,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1167,7 +1172,7 @@ async def generalize( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1217,7 +1222,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1299,7 +1304,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1386,7 +1391,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1469,7 +1474,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1533,7 +1538,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1590,7 +1595,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1653,7 +1658,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1710,7 +1715,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1773,7 +1778,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1830,7 +1835,7 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1893,7 +1898,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1950,7 +1955,7 @@ async def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -2013,7 +2018,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2070,7 +2075,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2223,7 +2228,7 @@ async def begin_run_command( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_models_py3.py index e6b5eaecd631..7fc0829b6088 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -75,8 +80,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs @@ -4742,7 +4747,7 @@ class VirtualMachineIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is @@ -5411,7 +5416,7 @@ class VirtualMachineScaleSetIdentity(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: Optional[str] = None, **kwargs): + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs): """ :keyword type: The type of identity used for the virtual machine scale set. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Default value is diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py index 22ddb0eb7910..6c29681834be 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +143,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +199,7 @@ def build_list_available_sizes_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -328,7 +333,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -400,7 +405,7 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -460,7 +465,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -509,7 +514,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -591,7 +596,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -678,7 +683,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py index 2c42452b1ae9..ac80ab7d3666 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,7 +142,7 @@ def build_delete_request(resource_group_name: str, disk_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +199,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -220,7 +225,7 @@ def build_grant_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -254,7 +259,7 @@ def build_revoke_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +317,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -467,7 +472,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -524,7 +529,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -679,7 +684,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -748,7 +753,7 @@ def get(self, resource_group_name: str, disk_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -796,7 +801,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -861,7 +866,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -915,7 +920,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -995,7 +1000,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1080,7 +1085,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1239,7 +1244,7 @@ def begin_grant_access( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1296,7 +1301,7 @@ def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1361,7 +1366,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py index 0aee7c49a2b9..fe5114a4ddf9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_delete_request(resource_group_name: str, image_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +143,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,7 +224,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -368,7 +373,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -425,7 +430,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -488,7 +493,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -556,7 +561,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -605,7 +610,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -686,7 +691,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py index bf2e00c2a101..fa84aa803bbd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +96,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py index f48331d9af56..a3045af05339 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,7 @@ def build_grant_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -258,7 +263,7 @@ def build_revoke_access_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -316,7 +321,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -471,7 +476,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -528,7 +533,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -685,7 +690,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -754,7 +759,7 @@ def get(self, resource_group_name: str, snapshot_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -802,7 +807,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -867,7 +872,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -921,7 +926,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1001,7 +1006,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1086,7 +1091,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1245,7 +1250,7 @@ def begin_grant_access( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1302,7 +1307,7 @@ def _revoke_access_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_revoke_access_request( @@ -1367,7 +1372,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py index 7301b32c38d0..94d26a6dc8fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py index 94a3f84e941b..84394e05e031 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py index b8cfbeef6305..343113732457 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -391,7 +396,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -454,7 +459,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -626,7 +631,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -684,7 +689,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -751,7 +756,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -827,7 +832,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py index f1783f7e96bb..e2f9829ed48e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py index 89fab5cfff9c..c0ddf254678c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py index d67d3bd6f27f..ccb5f947c33b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,7 +122,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +156,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -390,7 +395,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -448,7 +453,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -515,7 +520,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -591,7 +596,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -647,7 +652,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index b5a85f3be11e..79c7ef07b62e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_cancel_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_start_os_upgrade_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,7 @@ def build_get_latest_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def _cancel_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_cancel_request( @@ -225,7 +230,7 @@ def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -281,7 +286,7 @@ def _start_os_upgrade_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_os_upgrade_request( @@ -346,7 +351,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -414,7 +419,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py index 1356a3cebe1d..e15e6ce12707 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_reimage_all_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +113,7 @@ def build_deallocate_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +209,7 @@ def build_get_instance_view_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +287,7 @@ def build_power_off_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -314,7 +319,7 @@ def build_restart_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_start_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -405,7 +410,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -471,7 +476,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +533,7 @@ def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -595,7 +600,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -652,7 +657,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -720,7 +725,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -777,7 +782,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -843,7 +848,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -912,7 +917,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -975,7 +980,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1046,7 +1051,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1132,7 +1137,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1200,7 +1205,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1257,7 +1262,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1323,7 +1328,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1380,7 +1385,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1446,7 +1451,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py index 26d566e57764..b41cb21a88af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def build_deallocate_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -208,7 +213,7 @@ def build_delete_instances_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -242,7 +247,7 @@ def build_get_instance_view_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -299,7 +304,7 @@ def build_list_all_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +332,7 @@ def build_list_skus_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +363,7 @@ def build_power_off_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -392,7 +397,7 @@ def build_restart_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -426,7 +431,7 @@ def build_start_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -460,7 +465,7 @@ def build_update_instances_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -494,7 +499,7 @@ def build_reimage_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -528,7 +533,7 @@ def build_reimage_all_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -593,7 +598,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -751,7 +756,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -812,7 +817,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -966,7 +971,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1023,7 +1028,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1086,7 +1091,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1150,7 +1155,7 @@ def get(self, resource_group_name: str, vm_scale_set_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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1202,7 +1207,7 @@ def _deallocate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1372,7 +1377,7 @@ def begin_deallocate( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1435,7 +1440,7 @@ def _delete_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1596,7 +1601,7 @@ def begin_delete_instances( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1667,7 +1672,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1717,7 +1722,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1801,7 +1806,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1889,7 +1894,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1976,7 +1981,7 @@ def _power_off_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2146,7 +2151,7 @@ def begin_power_off( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2209,7 +2214,7 @@ def _restart_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2373,7 +2378,7 @@ def begin_restart( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2436,7 +2441,7 @@ def _start_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2600,7 +2605,7 @@ def begin_start( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2663,7 +2668,7 @@ def _update_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2824,7 +2829,7 @@ def begin_update_instances( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2887,7 +2892,7 @@ def _reimage_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3051,7 +3056,7 @@ def begin_reimage( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3114,7 +3119,7 @@ def _reimage_all_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3281,7 +3286,7 @@ def begin_reimage_all( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py index 84d53529b2b1..ee5d66cec6bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py index 25b2beee1fc1..037c47f65f7b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_get_extensions_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +108,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -169,7 +174,7 @@ def build_delete_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,12 +200,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -233,7 +243,7 @@ def build_instance_view_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -264,7 +274,7 @@ def build_convert_to_managed_disks_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -295,7 +305,7 @@ def build_deallocate_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -326,7 +336,7 @@ def build_generalize_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -355,7 +365,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -383,7 +393,7 @@ def build_list_all_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -409,7 +419,7 @@ def build_list_available_sizes_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -438,7 +448,7 @@ def build_power_off_request(resource_group_name: str, vm_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -467,7 +477,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -496,7 +506,7 @@ def build_start_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -525,7 +535,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -556,7 +566,7 @@ def build_perform_maintenance_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -587,7 +597,7 @@ def build_run_command_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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -662,7 +672,7 @@ def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -712,7 +722,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -798,7 +808,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -958,7 +968,7 @@ def begin_capture( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1017,7 +1027,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1169,7 +1179,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1226,7 +1236,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1289,7 +1299,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1331,7 +1341,7 @@ def get_long_running_output(pipeline_response): @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1358,7 +1368,7 @@ 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", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1419,7 +1429,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1467,7 +1477,7 @@ def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -1531,7 +1541,7 @@ def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1587,7 +1597,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1651,7 +1661,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1717,7 +1727,7 @@ def generalize(self, resource_group_name: str, vm_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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1766,7 +1776,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1847,7 +1857,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1933,7 +1943,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2016,7 +2026,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -2080,7 +2090,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2136,7 +2146,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -2199,7 +2209,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2255,7 +2265,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -2318,7 +2328,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2374,7 +2384,7 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -2437,7 +2447,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2493,7 +2503,7 @@ def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -2556,7 +2566,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2612,7 +2622,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2762,7 +2772,7 @@ def begin_run_command( _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-03-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-03-30")) # type: Literal["2017-03-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py index 066943e2f71f..bfcbef131689 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-09-01") # type: str + api_version = kwargs.pop("api_version", "2017-09-01") # type: Literal["2017-09-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json index 2e0a0b98fc5e..050912057f49 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json @@ -99,4 +99,4 @@ "operation_groups": { "resource_skus": "ResourceSkusOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py index 692c85d0007f..79f89dfe5c3f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-09-01") # type: str + api_version = kwargs.pop("api_version", "2017-09-01") # type: Literal["2017-09-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py index a44f191879ae..78d3ff7d4245 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._resource_skus_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]] @@ -65,7 +70,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceSku"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-09-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-09-01")) # type: Literal["2017-09-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py index 9bbe26e3db0c..dff654ca25be 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,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", "2017-09-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-09-01")) # type: Literal["2017-09-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +96,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceSku"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-09-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-09-01")) # type: Literal["2017-09-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py index ea649d379066..eadc9a983a66 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-12-01") # type: str + api_version = kwargs.pop("api_version", "2017-12-01") # type: Literal["2017-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json index 11a3de0d89c0..e5a228119a92 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json @@ -113,4 +113,4 @@ "log_analytics": "LogAnalyticsOperations", "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py index 6ad82f6e77f3..99662f4a3834 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-12-01") # type: str + api_version = kwargs.pop("api_version", "2017-12-01") # type: Literal["2017-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py index 1b779157a9ac..b12f8c3ddcac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -419,7 +424,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -471,7 +476,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -554,7 +559,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -642,7 +647,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py index 129ebab96de4..00fd18aaa9d7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -551,7 +556,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -619,7 +624,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py index 512af81b4478..40c72d80a031 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py index 73938cda55d1..76c38e2abd1f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py index 2ec245793bb0..ac116be6253f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py index a8e5ddde84a3..5612e87c320d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py index b328bfeefee2..dee3e3dd783f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -251,7 +256,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -486,7 +491,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -544,7 +549,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -611,7 +616,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -687,7 +692,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py index 2a45a5cb7715..cc77bebda8dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py index 1472c4a60ec6..e01466ae590c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, 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]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 45ed31b9540b..0b672ade2e8a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ 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]] @@ -79,7 +84,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -380,7 +385,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -456,7 +461,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -512,7 +517,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 6123bea9fde5..37117cbdeb96 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_start_os_upgrade_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]] @@ -70,7 +75,7 @@ async def _cancel_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_cancel_request( @@ -133,7 +138,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -190,7 +195,7 @@ async def _start_os_upgrade_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_os_upgrade_request( @@ -255,7 +260,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -324,7 +329,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 79ae3b7e84e6..1d639f821b34 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,6 +47,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ async def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -149,7 +154,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -207,7 +212,7 @@ async def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -274,7 +279,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -332,7 +337,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -400,7 +405,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -463,7 +468,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -637,7 +642,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -695,7 +700,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -761,7 +766,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -830,7 +835,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -893,7 +898,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -964,7 +969,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1050,7 +1055,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1118,7 +1123,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1242,7 +1247,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1300,7 +1305,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1366,7 +1371,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1424,7 +1429,7 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1491,7 +1496,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1549,7 +1554,7 @@ async def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -1615,7 +1620,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py index 5127386dfb80..06a050df2790 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -467,7 +472,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -524,7 +529,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -587,7 +592,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -653,7 +658,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -705,7 +710,7 @@ async def _deallocate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -875,7 +880,7 @@ async def begin_deallocate( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -939,7 +944,7 @@ async def _delete_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1100,7 +1105,7 @@ async def begin_delete_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1172,7 +1177,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1222,7 +1227,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1306,7 +1311,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1394,7 +1399,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1483,7 +1488,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1570,7 +1575,7 @@ async def _power_off_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1740,7 +1745,7 @@ async def begin_power_off( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1804,7 +1809,7 @@ async def _restart_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1968,7 +1973,7 @@ async def begin_restart( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2032,7 +2037,7 @@ async def _start_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2196,7 +2201,7 @@ async def begin_start( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2260,7 +2265,7 @@ async def _redeploy_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2427,7 +2432,7 @@ async def begin_redeploy( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2491,7 +2496,7 @@ async def _perform_maintenance_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2664,7 +2669,7 @@ async def begin_perform_maintenance( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2728,7 +2733,7 @@ async def _update_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2889,7 +2894,7 @@ async def begin_update_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2953,7 +2958,7 @@ async def _reimage_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3117,7 +3122,7 @@ async def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -3181,7 +3186,7 @@ async def _reimage_all_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3348,7 +3353,7 @@ async def begin_reimage_all( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -3424,7 +3429,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py index e8c7060201b0..8e1c059e5801 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py index f32c42489401..15d99dfdf023 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -104,7 +109,7 @@ async def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -155,7 +160,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -241,7 +246,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -401,7 +406,7 @@ async def begin_capture( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -616,7 +621,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -673,7 +678,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -828,7 +833,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -885,7 +890,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -948,7 +953,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -990,7 +995,7 @@ def get_long_running_output(pipeline_response): @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1017,7 +1022,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1078,7 +1083,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1126,7 +1131,7 @@ async def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -1190,7 +1195,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1247,7 +1252,7 @@ async def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1311,7 +1316,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1380,7 +1385,7 @@ async def generalize( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -1430,7 +1435,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1512,7 +1517,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1599,7 +1604,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1682,7 +1687,7 @@ async def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1746,7 +1751,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1866,7 +1871,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1923,7 +1928,7 @@ async def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1986,7 +1991,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2043,7 +2048,7 @@ async def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -2106,7 +2111,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2163,7 +2168,7 @@ async def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -2226,7 +2231,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2283,7 +2288,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2436,7 +2441,7 @@ async def begin_run_command( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_models_py3.py index 38c860e8848c..7619f69ea790 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -52,8 +57,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py index 13be5bb5ec16..8ed3ece4fd05 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -228,7 +233,7 @@ def build_list_available_sizes_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -362,7 +367,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -498,7 +503,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -570,7 +575,7 @@ def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -630,7 +635,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -679,7 +684,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -761,7 +766,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -848,7 +853,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py index 1a21ee7524d4..0a69dd4a1c71 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_delete_request(resource_group_name: str, image_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -400,7 +405,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -457,7 +462,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -606,7 +611,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -663,7 +668,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -726,7 +731,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -794,7 +799,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -843,7 +848,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -924,7 +929,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py index 1c46fb240d90..8aaf7f430e76 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py index 0df387d912c0..f768dde7c395 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py index c42fb08d5b1b..4a1f550ea301 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py index d5de0e1700a9..c7fcc3452141 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py index 3be1cc1d12fd..17b9b9f887c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -391,7 +396,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -454,7 +459,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -626,7 +631,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -684,7 +689,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -751,7 +756,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -827,7 +832,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py index 08e1cc209a59..0e627f675de8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py index 90ced4f646ad..dbb381184640 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py index a6e5ab47248c..f3287e0866bc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,7 +122,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +156,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -390,7 +395,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -448,7 +453,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -515,7 +520,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -591,7 +596,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -647,7 +652,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 3adc6e819310..39a9f4f25bf2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_cancel_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_start_os_upgrade_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,7 @@ def build_get_latest_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def _cancel_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_cancel_request( @@ -225,7 +230,7 @@ def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -281,7 +286,7 @@ def _start_os_upgrade_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_os_upgrade_request( @@ -346,7 +351,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -414,7 +419,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py index b5f36f4e90ca..60a50dd23559 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_reimage_all_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +113,7 @@ def build_deallocate_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -175,7 +180,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,7 +244,7 @@ def build_get_instance_view_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -278,7 +283,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -317,7 +322,7 @@ def build_power_off_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -349,7 +354,7 @@ def build_restart_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -381,7 +386,7 @@ def build_start_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -413,7 +418,7 @@ def build_redeploy_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -445,7 +450,7 @@ def build_perform_maintenance_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -504,7 +509,7 @@ def _reimage_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_request( @@ -570,7 +575,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -627,7 +632,7 @@ def _reimage_all_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_reimage_all_request( @@ -694,7 +699,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -751,7 +756,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -819,7 +824,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -881,7 +886,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1055,7 +1060,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1113,7 +1118,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1179,7 +1184,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1248,7 +1253,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1311,7 +1316,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1382,7 +1387,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1468,7 +1473,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -1536,7 +1541,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1593,7 +1598,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -1659,7 +1664,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1716,7 +1721,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -1782,7 +1787,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1839,7 +1844,7 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -1906,7 +1911,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1963,7 +1968,7 @@ def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -2029,7 +2034,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py index e7260bf56eec..4b0a83266e29 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def build_deallocate_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -208,7 +213,7 @@ def build_delete_instances_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -242,7 +247,7 @@ def build_get_instance_view_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -299,7 +304,7 @@ def build_list_all_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +332,7 @@ def build_list_skus_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +363,7 @@ def build_get_os_upgrade_history_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -389,7 +394,7 @@ def build_power_off_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -423,7 +428,7 @@ def build_restart_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -457,7 +462,7 @@ def build_start_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -491,7 +496,7 @@ def build_redeploy_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -525,7 +530,7 @@ def build_perform_maintenance_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -559,7 +564,7 @@ def build_update_instances_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -593,7 +598,7 @@ def build_reimage_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -627,7 +632,7 @@ def build_reimage_all_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -666,7 +671,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -729,7 +734,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -887,7 +892,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -948,7 +953,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1102,7 +1107,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1159,7 +1164,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1222,7 +1227,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1286,7 +1291,7 @@ def get(self, resource_group_name: str, vm_scale_set_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1338,7 +1343,7 @@ def _deallocate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1508,7 +1513,7 @@ def begin_deallocate( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1571,7 +1576,7 @@ def _delete_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -1732,7 +1737,7 @@ def begin_delete_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1803,7 +1808,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1853,7 +1858,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1937,7 +1942,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2025,7 +2030,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2114,7 +2119,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2201,7 +2206,7 @@ def _power_off_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2371,7 +2376,7 @@ def begin_power_off( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2434,7 +2439,7 @@ def _restart_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2598,7 +2603,7 @@ def begin_restart( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2661,7 +2666,7 @@ def _start_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -2825,7 +2830,7 @@ def begin_start( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2888,7 +2893,7 @@ def _redeploy_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3055,7 +3060,7 @@ def begin_redeploy( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3118,7 +3123,7 @@ def _perform_maintenance_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3291,7 +3296,7 @@ def begin_perform_maintenance( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3354,7 +3359,7 @@ def _update_instances_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3515,7 +3520,7 @@ def begin_update_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3578,7 +3583,7 @@ def _reimage_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3742,7 +3747,7 @@ def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3805,7 +3810,7 @@ def _reimage_all_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] @@ -3972,7 +3977,7 @@ def begin_reimage_all( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -4047,7 +4052,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py index 2ee19dbd8649..e35785c51c62 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py index 1100f9707dd3..40077ad134b1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_get_extensions_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +108,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -169,7 +174,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -201,7 +206,7 @@ def build_delete_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -227,12 +232,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +275,7 @@ def build_instance_view_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -296,7 +306,7 @@ def build_convert_to_managed_disks_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +337,7 @@ def build_deallocate_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_generalize_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -387,7 +397,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -415,7 +425,7 @@ def build_list_all_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -441,7 +451,7 @@ def build_list_available_sizes_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -470,7 +480,7 @@ def build_power_off_request(resource_group_name: str, vm_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -499,7 +509,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -528,7 +538,7 @@ def build_start_request(resource_group_name: str, vm_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", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -557,7 +567,7 @@ def build_redeploy_request(resource_group_name: str, vm_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -588,7 +598,7 @@ def build_perform_maintenance_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -619,7 +629,7 @@ def build_run_command_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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -694,7 +704,7 @@ def get_extensions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_get_extensions_request( @@ -744,7 +754,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -830,7 +840,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -990,7 +1000,7 @@ def begin_capture( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1049,7 +1059,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1201,7 +1211,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1258,7 +1268,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1410,7 +1420,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1467,7 +1477,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_delete_request( @@ -1530,7 +1540,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1572,7 +1582,7 @@ def get_long_running_output(pipeline_response): @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1599,7 +1609,7 @@ 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", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1660,7 +1670,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1708,7 +1718,7 @@ def _convert_to_managed_disks_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_convert_to_managed_disks_request( @@ -1772,7 +1782,7 @@ def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1828,7 +1838,7 @@ def _deallocate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_deallocate_request( @@ -1892,7 +1902,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1958,7 +1968,7 @@ def generalize(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] request = build_generalize_request( @@ -2007,7 +2017,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2088,7 +2098,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2174,7 +2184,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2257,7 +2267,7 @@ def _power_off_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_power_off_request( @@ -2321,7 +2331,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2377,7 +2387,7 @@ def _restart_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_restart_request( @@ -2440,7 +2450,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2496,7 +2506,7 @@ def _start_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_start_request( @@ -2559,7 +2569,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2615,7 +2625,7 @@ def _redeploy_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_redeploy_request( @@ -2678,7 +2688,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2734,7 +2744,7 @@ def _perform_maintenance_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OperationStatusResponse]] request = build_perform_maintenance_request( @@ -2797,7 +2807,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatusResponse] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2853,7 +2863,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3003,7 +3013,7 @@ def begin_run_command( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-12-01")) # type: Literal["2017-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py index 1fe24d8d44b6..0b1c65a15b2d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-04-01") # type: str + api_version = kwargs.pop("api_version", "2018-04-01") # type: Literal["2018-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json index ee5713600c62..31ae51a6807a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json @@ -116,4 +116,4 @@ "disks": "DisksOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py index cb4ddb3e065f..6c7cbf835579 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-04-01") # type: str + api_version = kwargs.pop("api_version", "2018-04-01") # type: Literal["2018-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py index 73fbf3a5e921..1d0d579f35c3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py index 64093b7d5009..ee1fac3a7203 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py index 8d562757817f..2d6a97e36648 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py index 13a446aa4296..6391240c0e36 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py index 08df0c289343..f9c06e368e0a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py index f14c520ea8f4..17c59b7a65b3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -470,7 +475,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -555,7 +560,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py index ff597d8af9fb..d1ab7dd3d599 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py index 5b85039f2d59..3c91bc9bab8c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py index e32b9de63c5f..dee67afdca77 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py index bea1cda140b3..1f4e99103d5f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py index 0da3c0d97abe..4321c8244e38 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py index 56d360de5250..58d907eb125a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, 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]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 87ee1039f1be..7748695b19bc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ 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]] @@ -79,7 +84,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -372,7 +377,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -446,7 +451,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -502,7 +507,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 753386ff3746..a38d4561f6f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_start_os_upgrade_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]] @@ -70,7 +75,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -125,7 +130,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -177,7 +182,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -234,7 +239,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -298,7 +303,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index c793e5135636..c084c9ef0b18 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def _reimage_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -142,7 +147,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -195,7 +200,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -254,7 +259,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -307,7 +312,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -367,7 +372,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -425,7 +430,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -599,7 +604,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -657,7 +662,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -715,7 +720,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -782,7 +787,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -845,7 +850,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -916,7 +921,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1002,7 +1007,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1062,7 +1067,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1115,7 +1120,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1173,7 +1178,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1226,7 +1231,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1284,7 +1289,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1337,7 +1342,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1396,7 +1401,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1449,7 +1454,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1507,7 +1512,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1565,7 +1570,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -1732,7 +1737,7 @@ async def begin_run_command( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py index 78cbcc502a62..0fa35e27086a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -467,7 +472,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -524,7 +529,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -579,7 +584,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -643,7 +648,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -695,7 +700,7 @@ async def _deallocate_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -853,7 +858,7 @@ async def begin_deallocate( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -912,7 +917,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1061,7 +1066,7 @@ async def begin_delete_instances( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -1128,7 +1133,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1178,7 +1183,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1262,7 +1267,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1350,7 +1355,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1439,7 +1444,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1526,7 +1531,7 @@ async def _power_off_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1684,7 +1689,7 @@ async def begin_power_off( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -1743,7 +1748,7 @@ async def _restart_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1895,7 +1900,7 @@ async def begin_restart( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -1954,7 +1959,7 @@ async def _start_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2106,7 +2111,7 @@ async def begin_start( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -2165,7 +2170,7 @@ async def _redeploy_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2320,7 +2325,7 @@ async def begin_redeploy( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -2379,7 +2384,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2540,7 +2545,7 @@ async def begin_perform_maintenance( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -2599,7 +2604,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2748,7 +2753,7 @@ async def begin_update_instances( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -2807,7 +2812,7 @@ async def _reimage_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2959,7 +2964,7 @@ async def begin_reimage( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -3018,7 +3023,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3173,7 +3178,7 @@ async def begin_reimage_all( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -3244,7 +3249,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py index 35386e927462..25e7e98714f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py index 1a67f6360c37..fab2faf086f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -52,6 +53,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -177,7 +182,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -337,7 +342,7 @@ async def begin_capture( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -396,7 +401,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -551,7 +556,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -608,7 +613,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -763,7 +768,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -820,7 +825,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -873,7 +878,7 @@ async def begin_delete(self, resource_group_name: str, vm_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -913,7 +918,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -940,7 +945,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1001,7 +1006,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1049,7 +1054,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1105,7 +1110,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1157,7 +1162,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1211,7 +1216,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1275,7 +1280,7 @@ async def generalize( # 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1321,7 +1326,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1403,7 +1408,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1490,7 +1495,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1573,7 +1578,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1627,7 +1632,7 @@ async def begin_power_off(self, resource_group_name: str, vm_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1679,7 +1684,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1732,7 +1737,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1784,7 +1789,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1837,7 +1842,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1889,7 +1894,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1942,7 +1947,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1994,7 +1999,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2049,7 +2054,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2101,7 +2106,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2254,7 +2259,7 @@ async def begin_run_command( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_models_py3.py index 73f732916089..6ca9de909e36 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -75,8 +80,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py index feea11ad9042..19c2b5b8310f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py index 797913280872..685853b969a5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py index 216b39ec33f5..293f2c0f5eb6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py index 8a0ad176ce0b..f5ec93c91cbc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py index 4aaca8691b5f..d4adc3461e92 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py index 9e0cd881c546..8a3961b773c6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -141,7 +146,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -333,7 +338,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -475,7 +480,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -547,7 +552,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -603,7 +608,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -651,7 +656,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -736,7 +741,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py index cccdf59898e5..fbc30a946ff7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py index f4bdb1831615..3350168f96c9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py index 2e414ea92e79..9fd9954fe04c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py index 39f8f98c3cbe..cc9abf84b4d0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py index 9742a523b957..8fd1b0c05fe2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py index 17418514497d..aceb9e75cc13 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py index 2b0fda114358..51260f2058d5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -111,7 +116,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +150,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -384,7 +389,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -442,7 +447,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -501,7 +506,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -575,7 +580,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -631,7 +636,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 153e77fba5c7..1f3f8530f271 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -92,7 +97,7 @@ def build_get_latest_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -203,7 +208,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -255,7 +260,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -312,7 +317,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -376,7 +381,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py index 479f6274c370..650006e622e4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +48,7 @@ def build_reimage_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -69,7 +74,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -95,7 +100,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -122,7 +127,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -156,7 +161,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +188,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_get_instance_view_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,7 +259,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -292,7 +297,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -318,7 +323,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -344,7 +349,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -370,7 +375,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -396,7 +401,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -423,7 +428,7 @@ def build_run_command_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -485,7 +490,7 @@ def _reimage_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -543,7 +548,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -596,7 +601,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -655,7 +660,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -708,7 +713,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -768,7 +773,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1000,7 +1005,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1058,7 +1063,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1116,7 +1121,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1183,7 +1188,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1246,7 +1251,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1317,7 +1322,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1403,7 +1408,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1463,7 +1468,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1516,7 +1521,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1574,7 +1579,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1627,7 +1632,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1685,7 +1690,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1738,7 +1743,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1797,7 +1802,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1850,7 +1855,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1908,7 +1913,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1966,7 +1971,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2130,7 +2135,7 @@ def begin_run_command( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py index 11ce71617a7c..bc33ca83b711 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -377,7 +382,7 @@ def build_power_off_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -408,7 +413,7 @@ def build_restart_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -439,7 +444,7 @@ def build_start_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -470,7 +475,7 @@ def build_redeploy_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -501,7 +506,7 @@ def build_perform_maintenance_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -532,7 +537,7 @@ def build_update_instances_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -563,7 +568,7 @@ def build_reimage_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -594,7 +599,7 @@ def build_reimage_all_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -630,7 +635,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -693,7 +698,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -851,7 +856,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -912,7 +917,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1066,7 +1071,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1123,7 +1128,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1176,7 +1181,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1238,7 +1243,7 @@ def get(self, resource_group_name: str, vm_scale_set_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1290,7 +1295,7 @@ def _deallocate_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1448,7 +1453,7 @@ def begin_deallocate( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -1507,7 +1512,7 @@ def _delete_instances_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1656,7 +1661,7 @@ def begin_delete_instances( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -1723,7 +1728,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1773,7 +1778,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1857,7 +1862,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1945,7 +1950,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2034,7 +2039,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2121,7 +2126,7 @@ def _power_off_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2279,7 +2284,7 @@ def begin_power_off( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -2338,7 +2343,7 @@ def _restart_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2490,7 +2495,7 @@ def begin_restart( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -2549,7 +2554,7 @@ def _start_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2701,7 +2706,7 @@ def begin_start( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -2760,7 +2765,7 @@ def _redeploy_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2915,7 +2920,7 @@ def begin_redeploy( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -2974,7 +2979,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3135,7 +3140,7 @@ def begin_perform_maintenance( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -3194,7 +3199,7 @@ def _update_instances_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3343,7 +3348,7 @@ def begin_update_instances( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -3402,7 +3407,7 @@ def _reimage_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3554,7 +3559,7 @@ def begin_reimage( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -3613,7 +3618,7 @@ def _reimage_all_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3768,7 +3773,7 @@ def begin_reimage_all( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-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] @@ -3839,7 +3844,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py index dd81e61a0053..c5527d3c0a6e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py index c6085e0084de..d4faaa44bf51 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -384,7 +394,7 @@ def build_list_available_sizes_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -412,7 +422,7 @@ def build_list_available_sizes_request( def build_power_off_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -435,7 +445,7 @@ def build_power_off_request(resource_group_name: str, vm_name: str, subscription def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -458,7 +468,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -481,7 +491,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -506,7 +516,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -532,7 +542,7 @@ def build_run_command_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -594,7 +604,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -680,7 +690,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -840,7 +850,7 @@ def begin_capture( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -899,7 +909,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1051,7 +1061,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1108,7 +1118,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1260,7 +1270,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1317,7 +1327,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1370,7 +1380,7 @@ def begin_delete(self, resource_group_name: str, vm_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1410,7 +1420,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1437,7 +1447,7 @@ 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1498,7 +1508,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1546,7 +1556,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1600,7 +1610,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1652,7 +1662,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1706,7 +1716,7 @@ def begin_deallocate(self, resource_group_name: str, vm_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1770,7 +1780,7 @@ def generalize( # 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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1815,7 +1825,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1896,7 +1906,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1982,7 +1992,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2065,7 +2075,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2119,7 +2129,7 @@ def begin_power_off(self, resource_group_name: str, vm_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2171,7 +2181,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2224,7 +2234,7 @@ def begin_restart(self, resource_group_name: str, vm_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2276,7 +2286,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2329,7 +2339,7 @@ def begin_start(self, resource_group_name: str, vm_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2381,7 +2391,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2434,7 +2444,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2486,7 +2496,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2539,7 +2549,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2591,7 +2601,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2741,7 +2751,7 @@ def begin_run_command( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-04-01")) # type: Literal["2018-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py index 373836347d12..737d1cfc17a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-06-01") # type: str + api_version = kwargs.pop("api_version", "2018-06-01") # type: Literal["2018-06-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json index c6a5084f44cd..0011fc440d6f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json @@ -119,4 +119,4 @@ "disks": "DisksOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py index 4a5c0ec02d3c..a7424de66fe6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-06-01") # type: str + api_version = kwargs.pop("api_version", "2018-06-01") # type: Literal["2018-06-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py index 6593f353297b..f6f63ca78c4a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2018-06-01")) # type: str + 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.AvailabilitySet] @@ -287,7 +292,7 @@ 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", "2018-06-01")) # type: str + 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.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _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: str + 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.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2018-06-01")) # type: str + 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.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _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: str + 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.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py index b7ab2e3e848b..f2c29e01269e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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", "2018-06-01")) # type: str + 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.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _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: str + 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.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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: str + 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.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py index a61b92476f6c..d2c0d51fc295 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ 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]] @@ -75,7 +80,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Gallery] @@ -238,7 +243,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -305,7 +310,7 @@ async def get(self, resource_group_name: str, gallery_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", "2018-06-01")) # type: str + 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.Gallery] request = build_get_request( @@ -353,7 +358,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -406,7 +411,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -458,7 +463,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.GalleryList] error_map = { @@ -538,7 +543,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _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: str + 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.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py index 7df3795e5eb8..5131a6a9a72e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_image_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.GalleryImageVersion] @@ -279,7 +284,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -366,7 +371,7 @@ 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", "2018-06-01")) # type: str + 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.GalleryImageVersion] request = build_get_request( @@ -422,7 +427,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -491,7 +496,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -554,7 +559,7 @@ def list_by_gallery_image( _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: str + 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.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py index 1cc48f5c6ed5..37e37945efb5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.GalleryImage] @@ -259,7 +264,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -332,7 +337,7 @@ 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", "2018-06-01")) # type: str + 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.GalleryImage] request = build_get_request( @@ -381,7 +386,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -440,7 +445,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -499,7 +504,7 @@ def list_by_gallery( _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: str + 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.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py index 9551357f3906..f835f9cb19b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2018-06-01")) # type: str + 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.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _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: str + 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.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py index 7a45fdd20ee1..ed8cac9d2b83 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py index 1b35e883a7d7..b56b5c978c21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _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: str + 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.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py index 25f2c75a4f79..67625bca7bb3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2018-06-01")) # type: str + 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.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", "2018-06-01")) # type: str + 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.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -422,7 +427,7 @@ 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", "2018-06-01")) # type: str + 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.ProximityPlacementGroup] request = build_get_request( @@ -470,7 +475,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _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: str + 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.ProximityPlacementGroupListResult] error_map = { @@ -555,7 +560,7 @@ 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", "2018-06-01")) # type: str + 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.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py index ed743a0788dc..1f18aa2b529c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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", "2018-06-01")) # type: str + 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.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _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: str + 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.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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: str + 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.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py index c7f282ca61f0..820d41847200 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _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: str + 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.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py index 680fa304eb9e..71f1f2bc1c39 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py index 5488bd2c61e4..8e32239210fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py index c29e514a0fdb..b556b88ca429 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2018-06-01")) # type: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py index 5ae8e73f42ec..fe354439defc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, 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]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _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: str + 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.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2018-06-01")) # type: str + 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.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 7bebaf531c77..aea7640e9e1a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ 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]] @@ -79,7 +84,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -372,7 +377,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -446,7 +451,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetExtension] request = build_get_request( @@ -502,7 +507,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 51f5b4ab8c97..2fc9018476ec 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _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: str + 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[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _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: str + 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.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 7fc13aa31fdc..fcae5856dde0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def _reimage_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", "2018-06-01")) # type: str + 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[None] @@ -251,7 +256,7 @@ async def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -307,7 +312,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _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: str + 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[None] request = build_reimage_all_request( @@ -366,7 +371,7 @@ async def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_deallocate_request( @@ -479,7 +484,7 @@ async def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -537,7 +542,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetVM] @@ -711,7 +716,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -769,7 +774,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -827,7 +832,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetVM] request = build_get_request( @@ -957,7 +962,7 @@ async def get_instance_view( _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: str + 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.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1028,7 +1033,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetVMListResult] error_map = { @@ -1114,7 +1119,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_power_off_request( @@ -1174,7 +1179,7 @@ async def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1227,7 +1232,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_restart_request( @@ -1285,7 +1290,7 @@ async def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1338,7 +1343,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_start_request( @@ -1396,7 +1401,7 @@ async def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1449,7 +1454,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_redeploy_request( @@ -1508,7 +1513,7 @@ async def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1561,7 +1566,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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: str + 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[None] request = build_perform_maintenance_request( @@ -1619,7 +1624,7 @@ async def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1677,7 +1682,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -1844,7 +1849,7 @@ async def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py index 8413bd9dd4a6..593af2afb692 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSet] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSet] @@ -467,7 +472,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -524,7 +529,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -579,7 +584,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -643,7 +648,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineScaleSet] request = build_get_request( @@ -695,7 +700,7 @@ async def _deallocate_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", "2018-06-01")) # type: str + 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[None] @@ -853,7 +858,7 @@ async def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -912,7 +917,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] @@ -1061,7 +1066,7 @@ async def begin_delete_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1128,7 +1133,7 @@ async def get_instance_view( _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: str + 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.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1178,7 +1183,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _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: str + 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.VirtualMachineScaleSetListResult] error_map = { @@ -1262,7 +1267,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _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: str + 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.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1350,7 +1355,7 @@ def list_skus( _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: str + 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.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1439,7 +1444,7 @@ def get_os_upgrade_history( _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: str + 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.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1526,7 +1531,7 @@ async def _power_off_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", "2018-06-01")) # type: str + 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[None] @@ -1684,7 +1689,7 @@ async def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1743,7 +1748,7 @@ async def _restart_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", "2018-06-01")) # type: str + 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[None] @@ -1895,7 +1900,7 @@ async def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1954,7 +1959,7 @@ async def _start_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", "2018-06-01")) # type: str + 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[None] @@ -2106,7 +2111,7 @@ async def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2165,7 +2170,7 @@ async def _redeploy_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", "2018-06-01")) # type: str + 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[None] @@ -2320,7 +2325,7 @@ async def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2379,7 +2384,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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: str + 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[None] @@ -2540,7 +2545,7 @@ async def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2599,7 +2604,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] @@ -2748,7 +2753,7 @@ async def begin_update_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2807,7 +2812,7 @@ async def _reimage_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", "2018-06-01")) # type: str + 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[None] @@ -2963,7 +2968,7 @@ async def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -3022,7 +3027,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] @@ -3177,7 +3182,7 @@ async def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -3248,7 +3253,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _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: str + 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.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py index 45056dd39fa7..a34cc0c9ccd4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py index b07624206f35..f078a54a22be 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _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: str + 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.VirtualMachineListResult] error_map = { @@ -178,7 +183,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.VirtualMachineCaptureResult]] @@ -338,7 +343,7 @@ async def begin_capture( _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: str + 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.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -397,7 +402,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachine] @@ -552,7 +557,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -609,7 +614,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachine] @@ -764,7 +769,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -821,7 +826,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -874,7 +879,7 @@ async def begin_delete(self, resource_group_name: str, vm_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -914,7 +919,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -941,7 +946,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachine] request = build_get_request( @@ -1002,7 +1007,7 @@ async def instance_view( _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: str + 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.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1050,7 +1055,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _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: str + 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[None] request = build_convert_to_managed_disks_request( @@ -1106,7 +1111,7 @@ async def begin_convert_to_managed_disks( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1158,7 +1163,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_deallocate_request( @@ -1212,7 +1217,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1276,7 +1281,7 @@ async def generalize( # 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", "2018-06-01")) # type: str + 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[None] request = build_generalize_request( @@ -1322,7 +1327,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _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: str + 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.VirtualMachineListResult] error_map = { @@ -1404,7 +1409,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _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: str + 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.VirtualMachineListResult] error_map = { @@ -1491,7 +1496,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { @@ -1574,7 +1579,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_power_off_request( @@ -1628,7 +1633,7 @@ async def begin_power_off(self, resource_group_name: str, vm_name: str, **kwargs _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1680,7 +1685,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_restart_request( @@ -1733,7 +1738,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1785,7 +1790,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_start_request( @@ -1838,7 +1843,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1890,7 +1895,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_redeploy_request( @@ -1943,7 +1948,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1999,7 +2004,7 @@ async def _reimage_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", "2018-06-01")) # type: str + 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[None] @@ -2149,7 +2154,7 @@ async def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2204,7 +2209,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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: str + 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[None] request = build_perform_maintenance_request( @@ -2259,7 +2264,7 @@ async def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2311,7 +2316,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -2464,7 +2469,7 @@ async def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py index a5ac73d8bebe..b669defda5b8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -101,8 +106,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py index 6eca00470425..9963a939a873 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2018-06-01")) # type: str + 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.AvailabilitySet] @@ -492,7 +497,7 @@ 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", "2018-06-01")) # type: str + 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.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _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: str + 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.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _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: str + 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.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _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: str + 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.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py index 0dfb8a88b407..b938732ec096 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2018-06-01")) # type: str + 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.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _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: str + 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.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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: str + 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.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py index 591552dd0068..7624cf3080db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_get_request(resource_group_name: str, gallery_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +222,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Gallery] @@ -377,7 +382,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -444,7 +449,7 @@ def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) -> _mo _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: str + 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.Gallery] request = build_get_request( @@ -492,7 +497,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -545,7 +550,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -597,7 +602,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.GalleryList] error_map = { @@ -677,7 +682,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _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: str + 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.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py index 069e842ff417..2e86bfaabe6c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -92,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,7 +170,7 @@ def build_list_by_gallery_image_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,7 +235,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.GalleryImageVersion] @@ -429,7 +434,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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", "2018-06-01")) # type: str + 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.GalleryImageVersion] request = build_get_request( @@ -572,7 +577,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -641,7 +646,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -704,7 +709,7 @@ def list_by_gallery_image( _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: str + 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.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py index 7ac178d382ea..ac4e7f7652ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_list_by_gallery_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.GalleryImage] @@ -386,7 +391,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -459,7 +464,7 @@ 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", "2018-06-01")) # type: str + 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.GalleryImage] request = build_get_request( @@ -508,7 +513,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -567,7 +572,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -625,7 +630,7 @@ def list_by_gallery( _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: str + 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.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py index a8758da0f9bc..65602fba631e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2018-06-01")) # type: str + 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.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _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: str + 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.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py index 6cc17a2e8ae3..72c1dc239169 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py index be65f42f9672..4fb473994f60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _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: str + 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.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py index aeae1e0064f3..3907aaa62f2f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -141,7 +146,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -333,7 +338,7 @@ 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", "2018-06-01")) # type: str + 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.ProximityPlacementGroup] @@ -475,7 +480,7 @@ 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", "2018-06-01")) # type: str + 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.ProximityPlacementGroup] @@ -547,7 +552,7 @@ 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", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -603,7 +608,7 @@ 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", "2018-06-01")) # type: str + 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.ProximityPlacementGroup] request = build_get_request( @@ -651,7 +656,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _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: str + 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.ProximityPlacementGroupListResult] error_map = { @@ -736,7 +741,7 @@ 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", "2018-06-01")) # type: str + 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.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py index a842021ab277..87ccc53d1565 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2018-06-01")) # type: str + 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.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _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: str + 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.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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: str + 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.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py index 57a0f0ed0a8a..3376be30ccf4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _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: str + 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.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py index 53e7f1e8f85e..5d5f499d7086 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py index 4ca446f4fa69..3f702ef35cca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py index 9645ce299216..8b8bf6ca4b31 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2018-06-01")) # type: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py index 089097ad29a8..7688ea7aafa7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _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: str + 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.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _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: str + 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.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py index 87db8aa34e41..d1f18fead385 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -111,7 +116,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +150,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetExtension] @@ -384,7 +389,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -442,7 +447,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -501,7 +506,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -575,7 +580,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetExtension] request = build_get_request( @@ -631,7 +636,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index d374094f0de4..4732f296bf28 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _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: str + 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[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _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: str + 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.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py index cac387e8a425..b02ca7d8cfa6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,7 +194,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -221,7 +226,7 @@ def build_get_instance_view_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +265,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -298,7 +303,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -324,7 +329,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -350,7 +355,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -376,7 +381,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -402,7 +407,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -429,7 +434,7 @@ def build_run_command_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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -496,7 +501,7 @@ def _reimage_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", "2018-06-01")) # type: str + 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[None] @@ -658,7 +663,7 @@ def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -714,7 +719,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_reimage_all_request( @@ -773,7 +778,7 @@ def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_deallocate_request( @@ -886,7 +891,7 @@ def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -944,7 +949,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetVM] @@ -1118,7 +1123,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1176,7 +1181,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -1234,7 +1239,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1301,7 +1306,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetVM] request = build_get_request( @@ -1364,7 +1369,7 @@ def get_instance_view( _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: str + 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.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1435,7 +1440,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachineScaleSetVMListResult] error_map = { @@ -1521,7 +1526,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_power_off_request( @@ -1581,7 +1586,7 @@ def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1634,7 +1639,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_restart_request( @@ -1692,7 +1697,7 @@ def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1745,7 +1750,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_start_request( @@ -1803,7 +1808,7 @@ def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1856,7 +1861,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_redeploy_request( @@ -1915,7 +1920,7 @@ def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1968,7 +1973,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_perform_maintenance_request( @@ -2026,7 +2031,7 @@ def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2084,7 +2089,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -2248,7 +2253,7 @@ def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py index 24d600ec9000..50e2f35a2d58 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -377,7 +382,7 @@ def build_power_off_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -408,7 +413,7 @@ def build_restart_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -439,7 +444,7 @@ def build_start_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -470,7 +475,7 @@ def build_redeploy_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -501,7 +506,7 @@ def build_perform_maintenance_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -532,7 +537,7 @@ def build_update_instances_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -563,7 +568,7 @@ def build_reimage_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -594,7 +599,7 @@ def build_reimage_all_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", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -630,7 +635,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -693,7 +698,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSet] @@ -851,7 +856,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -912,7 +917,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSet] @@ -1066,7 +1071,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1123,7 +1128,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -1176,7 +1181,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1238,7 +1243,7 @@ def get(self, resource_group_name: str, vm_scale_set_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", "2018-06-01")) # type: str + 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.VirtualMachineScaleSet] request = build_get_request( @@ -1290,7 +1295,7 @@ def _deallocate_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", "2018-06-01")) # type: str + 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[None] @@ -1448,7 +1453,7 @@ def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1507,7 +1512,7 @@ def _delete_instances_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", "2018-06-01")) # type: str + 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[None] @@ -1656,7 +1661,7 @@ def begin_delete_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1723,7 +1728,7 @@ def get_instance_view( _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: str + 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.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1773,7 +1778,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _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: str + 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.VirtualMachineScaleSetListResult] error_map = { @@ -1857,7 +1862,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _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: str + 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.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1945,7 +1950,7 @@ def list_skus( _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: str + 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.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2034,7 +2039,7 @@ def get_os_upgrade_history( _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: str + 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.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2121,7 +2126,7 @@ def _power_off_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", "2018-06-01")) # type: str + 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[None] @@ -2279,7 +2284,7 @@ def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2338,7 +2343,7 @@ def _restart_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", "2018-06-01")) # type: str + 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[None] @@ -2490,7 +2495,7 @@ def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2549,7 +2554,7 @@ def _start_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", "2018-06-01")) # type: str + 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[None] @@ -2701,7 +2706,7 @@ def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2760,7 +2765,7 @@ def _redeploy_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", "2018-06-01")) # type: str + 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[None] @@ -2915,7 +2920,7 @@ def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2974,7 +2979,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] @@ -3135,7 +3140,7 @@ def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3194,7 +3199,7 @@ def _update_instances_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", "2018-06-01")) # type: str + 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[None] @@ -3343,7 +3348,7 @@ def begin_update_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3402,7 +3407,7 @@ def _reimage_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", "2018-06-01")) # type: str + 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[None] @@ -3558,7 +3563,7 @@ def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3617,7 +3622,7 @@ def _reimage_all_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", "2018-06-01")) # type: str + 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[None] @@ -3772,7 +3777,7 @@ def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3843,7 +3848,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _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: str + 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.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py index bc12cc1da7b3..b53809e20918 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py index bd4d87e2f7fc..5587faa88993 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -384,7 +394,7 @@ def build_list_available_sizes_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", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -412,7 +422,7 @@ def build_list_available_sizes_request( def build_power_off_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -435,7 +445,7 @@ def build_power_off_request(resource_group_name: str, vm_name: str, subscription def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -458,7 +468,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -481,7 +491,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -505,7 +515,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -535,7 +545,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -561,7 +571,7 @@ def build_run_command_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", "2018-06-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -623,7 +633,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _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: str + 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.VirtualMachineListResult] error_map = { @@ -709,7 +719,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.VirtualMachineCaptureResult]] @@ -869,7 +879,7 @@ def begin_capture( _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: str + 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.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -928,7 +938,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachine] @@ -1080,7 +1090,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1137,7 +1147,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachine] @@ -1289,7 +1299,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1346,7 +1356,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_delete_request( @@ -1399,7 +1409,7 @@ def begin_delete(self, resource_group_name: str, vm_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1439,7 +1449,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1466,7 +1476,7 @@ 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", "2018-06-01")) # type: str + 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.VirtualMachine] request = build_get_request( @@ -1527,7 +1537,7 @@ def instance_view( _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: str + 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.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1575,7 +1585,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_convert_to_managed_disks_request( @@ -1629,7 +1639,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1681,7 +1691,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_deallocate_request( @@ -1735,7 +1745,7 @@ def begin_deallocate(self, resource_group_name: str, vm_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1799,7 +1809,7 @@ def generalize( # 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", "2018-06-01")) # type: str + 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[None] request = build_generalize_request( @@ -1844,7 +1854,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _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: str + 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.VirtualMachineListResult] error_map = { @@ -1925,7 +1935,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _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: str + 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.VirtualMachineListResult] error_map = { @@ -2011,7 +2021,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { @@ -2094,7 +2104,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_power_off_request( @@ -2148,7 +2158,7 @@ def begin_power_off(self, resource_group_name: str, vm_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2200,7 +2210,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_restart_request( @@ -2253,7 +2263,7 @@ def begin_restart(self, resource_group_name: str, vm_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2305,7 +2315,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_start_request( @@ -2358,7 +2368,7 @@ def begin_start(self, resource_group_name: str, vm_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2410,7 +2420,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_redeploy_request( @@ -2463,7 +2473,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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", "2018-06-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2519,7 +2529,7 @@ def _reimage_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", "2018-06-01")) # type: str + 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[None] @@ -2669,7 +2679,7 @@ def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2724,7 +2734,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[None] request = build_perform_maintenance_request( @@ -2777,7 +2787,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2829,7 +2839,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -2979,7 +2989,7 @@ def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py index 6ac5110689ff..a9bbc0468cff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-09-30") # type: str + api_version = kwargs.pop("api_version", "2018-09-30") # type: Literal["2018-09-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json index 3f23cefeeea3..32e7800b37f8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json @@ -100,4 +100,4 @@ "disks": "DisksOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py index 4b8c7c0352d5..0358499f46a6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-09-30") # type: str + api_version = kwargs.pop("api_version", "2018-09-30") # type: Literal["2018-09-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py index 42d4f5a357d3..c763eedb9a50 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py index 140b9b5da717..229592ba0bca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py index fc58d7f90b2d..e8900b1b948e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py index 111b5484dbf1..e62cd155197e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30")) # type: Literal["2018-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py index c438b4d50439..a29250890767 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-10-01") # type: str + api_version = kwargs.pop("api_version", "2018-10-01") # type: Literal["2018-10-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json index de9718e9c1e6..2696f24168be 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json @@ -114,4 +114,4 @@ "log_analytics": "LogAnalyticsOperations", "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py index 55ba5b0ab43a..1ac7a939dd43 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-10-01") # type: str + api_version = kwargs.pop("api_version", "2018-10-01") # type: Literal["2018-10-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py index 223cea3b5e5b..9feb9691d992 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py index e3d1a46969a7..45df08237502 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py index d0c33fd94aa2..209b5f099371 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py index 111e7b6ba794..ff6f524ededa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py index 41f8dc758df1..7b1c9f8517c2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -470,7 +475,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -555,7 +560,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py index 6322635fa3a2..43608759be27 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py index c9ffa47c6ee3..f2b11b1eed46 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py index e856624ae200..565a4d297a44 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py index 2cacd805dd3f..899adcb7d34b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py index 1c219a11c563..38993fbc22c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, 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]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index a265e587d639..efee2cc34c32 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ 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]] @@ -79,7 +84,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -372,7 +377,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -446,7 +451,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -502,7 +507,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 14c43806dc49..6a50b2283c2c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 9b4059ae5cc2..8cc75c50fca3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def _reimage_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -251,7 +256,7 @@ async def begin_reimage( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -307,7 +312,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -366,7 +371,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -479,7 +484,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -537,7 +542,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -711,7 +716,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -769,7 +774,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -827,7 +832,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -957,7 +962,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1028,7 +1033,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1114,7 +1119,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1174,7 +1179,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1227,7 +1232,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1285,7 +1290,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1338,7 +1343,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1396,7 +1401,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1449,7 +1454,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1508,7 +1513,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1561,7 +1566,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1619,7 +1624,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1677,7 +1682,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -1844,7 +1849,7 @@ async def begin_run_command( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py index c7187431aacc..1a69e55e81cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -467,7 +472,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -524,7 +529,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -579,7 +584,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -643,7 +648,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -695,7 +700,7 @@ async def _deallocate_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -853,7 +858,7 @@ async def begin_deallocate( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -912,7 +917,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1061,7 +1066,7 @@ async def begin_delete_instances( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -1128,7 +1133,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1178,7 +1183,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1262,7 +1267,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1350,7 +1355,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1439,7 +1444,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1526,7 +1531,7 @@ async def _power_off_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1684,7 +1689,7 @@ async def begin_power_off( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -1743,7 +1748,7 @@ async def _restart_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1895,7 +1900,7 @@ async def begin_restart( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -1954,7 +1959,7 @@ async def _start_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2106,7 +2111,7 @@ async def begin_start( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -2165,7 +2170,7 @@ async def _redeploy_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2320,7 +2325,7 @@ async def begin_redeploy( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -2379,7 +2384,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2540,7 +2545,7 @@ async def begin_perform_maintenance( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -2599,7 +2604,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2748,7 +2753,7 @@ async def begin_update_instances( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -2807,7 +2812,7 @@ async def _reimage_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2963,7 +2968,7 @@ async def begin_reimage( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -3022,7 +3027,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3177,7 +3182,7 @@ async def begin_reimage_all( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -3248,7 +3253,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py index fd39f78e4170..e4af4f5f6266 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py index 164cda974441..23c4d6eb8e7b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -178,7 +183,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -338,7 +343,7 @@ async def begin_capture( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -397,7 +402,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -552,7 +557,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -609,7 +614,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -764,7 +769,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -821,7 +826,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -874,7 +879,7 @@ async def begin_delete(self, resource_group_name: str, vm_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -914,7 +919,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -941,7 +946,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1002,7 +1007,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1050,7 +1055,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1106,7 +1111,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1158,7 +1163,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1212,7 +1217,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1276,7 +1281,7 @@ async def generalize( # 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1322,7 +1327,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1404,7 +1409,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1491,7 +1496,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1574,7 +1579,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1628,7 +1633,7 @@ async def begin_power_off(self, resource_group_name: str, vm_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1680,7 +1685,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1733,7 +1738,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1785,7 +1790,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1838,7 +1843,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1890,7 +1895,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1943,7 +1948,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1999,7 +2004,7 @@ async def _reimage_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2149,7 +2154,7 @@ async def begin_reimage( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -2204,7 +2209,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2259,7 +2264,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2311,7 +2316,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2464,7 +2469,7 @@ async def begin_run_command( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py index a04eab44c796..cc7456d2b76f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -78,8 +83,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py index 91118c6b45e6..99ddde42a27e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py index 8047ad425e5a..805fda8e361a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py index 78eed1e37740..fb3c3771cb27 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py index 23a99f9862c3..cccefb211d8d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py index 881fa46b802d..14a01bbbaa24 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -141,7 +146,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -333,7 +338,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -475,7 +480,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -547,7 +552,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -603,7 +608,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -651,7 +656,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -736,7 +741,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py index 308743e6740f..7f4a140cca92 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py index 3d8e5e178b57..fb0be7c30559 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py index f6c718492a69..5f93263cbac3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py index 5c9ec3fc8164..dc5cc0ab2595 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py index 94a98153bee0..04b4ef6b4683 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py index 62cd284c2da4..7ed2c4511e58 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -111,7 +116,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +150,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -384,7 +389,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -442,7 +447,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -501,7 +506,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -575,7 +580,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -631,7 +636,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 835bf632d0f0..e719b6c42ac5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py index 8b52e471941d..d02013919041 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,7 +194,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -221,7 +226,7 @@ def build_get_instance_view_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +265,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -298,7 +303,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -324,7 +329,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -350,7 +355,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -376,7 +381,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -402,7 +407,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -429,7 +434,7 @@ def build_run_command_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -496,7 +501,7 @@ def _reimage_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -658,7 +663,7 @@ def begin_reimage( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -714,7 +719,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -773,7 +778,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -886,7 +891,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -944,7 +949,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1118,7 +1123,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1176,7 +1181,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1234,7 +1239,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1301,7 +1306,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1364,7 +1369,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1435,7 +1440,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1521,7 +1526,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1581,7 +1586,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1634,7 +1639,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1692,7 +1697,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1745,7 +1750,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1803,7 +1808,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1856,7 +1861,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1915,7 +1920,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1968,7 +1973,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2026,7 +2031,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2084,7 +2089,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2248,7 +2253,7 @@ def begin_run_command( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py index bfe5c314504c..b75b1138d96f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -377,7 +382,7 @@ def build_power_off_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -408,7 +413,7 @@ def build_restart_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -439,7 +444,7 @@ def build_start_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -470,7 +475,7 @@ def build_redeploy_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -501,7 +506,7 @@ def build_perform_maintenance_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -532,7 +537,7 @@ def build_update_instances_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -563,7 +568,7 @@ def build_reimage_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -594,7 +599,7 @@ def build_reimage_all_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -630,7 +635,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -693,7 +698,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -851,7 +856,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -912,7 +917,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1066,7 +1071,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1123,7 +1128,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1176,7 +1181,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1238,7 +1243,7 @@ def get(self, resource_group_name: str, vm_scale_set_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1290,7 +1295,7 @@ def _deallocate_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1448,7 +1453,7 @@ def begin_deallocate( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -1507,7 +1512,7 @@ def _delete_instances_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1656,7 +1661,7 @@ def begin_delete_instances( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -1723,7 +1728,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1773,7 +1778,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1857,7 +1862,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1945,7 +1950,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2034,7 +2039,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2121,7 +2126,7 @@ def _power_off_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2279,7 +2284,7 @@ def begin_power_off( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -2338,7 +2343,7 @@ def _restart_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2490,7 +2495,7 @@ def begin_restart( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -2549,7 +2554,7 @@ def _start_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2701,7 +2706,7 @@ def begin_start( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -2760,7 +2765,7 @@ def _redeploy_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2915,7 +2920,7 @@ def begin_redeploy( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -2974,7 +2979,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3135,7 +3140,7 @@ def begin_perform_maintenance( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -3194,7 +3199,7 @@ def _update_instances_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3343,7 +3348,7 @@ def begin_update_instances( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -3402,7 +3407,7 @@ def _reimage_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3558,7 +3563,7 @@ def begin_reimage( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -3617,7 +3622,7 @@ def _reimage_all_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3772,7 +3777,7 @@ def begin_reimage_all( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -3843,7 +3848,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py index ba9796b0f54a..8715f0b158ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py index 55394855856a..fe0765402991 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -384,7 +394,7 @@ def build_list_available_sizes_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -412,7 +422,7 @@ def build_list_available_sizes_request( def build_power_off_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -435,7 +445,7 @@ def build_power_off_request(resource_group_name: str, vm_name: str, subscription def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -458,7 +468,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -481,7 +491,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -505,7 +515,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -535,7 +545,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -561,7 +571,7 @@ def build_run_command_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -623,7 +633,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -709,7 +719,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -869,7 +879,7 @@ def begin_capture( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -928,7 +938,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1080,7 +1090,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1137,7 +1147,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1289,7 +1299,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1346,7 +1356,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1399,7 +1409,7 @@ def begin_delete(self, resource_group_name: str, vm_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1439,7 +1449,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1466,7 +1476,7 @@ 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1527,7 +1537,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1575,7 +1585,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1629,7 +1639,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1681,7 +1691,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1735,7 +1745,7 @@ def begin_deallocate(self, resource_group_name: str, vm_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1799,7 +1809,7 @@ def generalize( # 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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1844,7 +1854,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1925,7 +1935,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2011,7 +2021,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2094,7 +2104,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2148,7 +2158,7 @@ def begin_power_off(self, resource_group_name: str, vm_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2200,7 +2210,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2253,7 +2263,7 @@ def begin_restart(self, resource_group_name: str, vm_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2305,7 +2315,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2358,7 +2368,7 @@ def begin_start(self, resource_group_name: str, vm_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2410,7 +2420,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2463,7 +2473,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2519,7 +2529,7 @@ def _reimage_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", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2669,7 +2679,7 @@ def begin_reimage( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-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] @@ -2724,7 +2734,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2777,7 +2787,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2829,7 +2839,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2979,7 +2989,7 @@ def begin_run_command( _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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-10-01")) # type: Literal["2018-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py index 2c2732526ace..3fd767ddf7de 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-03-01") # type: str + api_version = kwargs.pop("api_version", "2019-03-01") # type: Literal["2019-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json index 986dbf89db79..7c2c9590aecb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json @@ -123,4 +123,4 @@ "disks": "DisksOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py index 9caf399bf93c..1943ffb9d7e3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-03-01") # type: str + api_version = kwargs.pop("api_version", "2019-03-01") # type: Literal["2019-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py index bc5126907456..53b23d4a1277 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py index aa923d490a35..54d524fcdcb9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ async def get(self, resource_group_name: str, host_group_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -474,7 +479,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -556,7 +561,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py index a9441e70dde4..24202d079089 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -638,7 +643,7 @@ async def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -668,7 +673,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -724,7 +729,7 @@ def list_by_host_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py index bfaf02f77f27..05afb4be5377 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py index 02ab682dc57d..844946c75dbe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ 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]] @@ -75,7 +80,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -238,7 +243,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -305,7 +310,7 @@ async def get(self, resource_group_name: str, gallery_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -353,7 +358,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -406,7 +411,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -458,7 +463,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -538,7 +543,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py index 7ea2e9843465..3be368d6dea5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_application_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -281,7 +286,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -368,7 +373,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -424,7 +429,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -493,7 +498,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -557,7 +562,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py index 15f1653998ad..0ec0674600d5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -262,7 +267,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -336,7 +341,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -385,7 +390,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -445,7 +450,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -504,7 +509,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py index 8397ab3d1e54..80ed8b090abc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_image_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -279,7 +284,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -366,7 +371,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -422,7 +427,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -491,7 +496,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -554,7 +559,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py index 41bb749ba378..bd48b96c27d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_list_by_gallery_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -259,7 +264,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -332,7 +337,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -381,7 +386,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -440,7 +445,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -499,7 +504,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py index aa669d7e7d64..e9a093decde1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py index cd8f3bbfd4eb..6f0565a11965 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py index b2bbb9dc3a8a..58055160d40d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py index 425526935c35..7383de74cd41 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -470,7 +475,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -555,7 +560,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py index 6c7d0277ecfb..36dce4120ddd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py index 9f99f1a44d78..a7f5937a6ff2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py index 0d8cf811e0a1..12fa16767037 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py index d1de0d0ea5eb..eaf2eb39101f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py index aa1a4af9f7ba..8828bb992cf3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py index 6e3b04f1fb24..217836d7c1ba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, 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]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 2bc49a91e4c4..9ead1a60bea4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ 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]] @@ -79,7 +84,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -372,7 +377,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -446,7 +451,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -502,7 +507,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index add33333344f..67c93ff8d543 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index dfe1f7a9ab77..e6127dfa3a4e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def _reimage_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -251,7 +256,7 @@ async def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -307,7 +312,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -366,7 +371,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -479,7 +484,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -537,7 +542,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -711,7 +716,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -769,7 +774,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -827,7 +832,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -872,7 +877,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -902,7 +907,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -966,7 +971,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1037,7 +1042,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1128,7 +1133,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1198,7 +1203,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1252,7 +1257,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1310,7 +1315,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1363,7 +1368,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1421,7 +1426,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1479,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1533,7 +1538,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1586,7 +1591,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1644,7 +1649,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1702,7 +1707,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -1869,7 +1874,7 @@ async def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py index 60cc3c9f7626..7c807f82a4df 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -54,6 +55,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -253,7 +258,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -468,7 +473,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -525,7 +530,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -580,7 +585,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -644,7 +649,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -696,7 +701,7 @@ async def _deallocate_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -854,7 +859,7 @@ async def begin_deallocate( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -913,7 +918,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1062,7 +1067,7 @@ async def begin_delete_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -1129,7 +1134,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1179,7 +1184,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1263,7 +1268,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1351,7 +1356,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1440,7 +1445,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1528,7 +1533,7 @@ async def _power_off_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1702,7 +1707,7 @@ async def begin_power_off( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -1762,7 +1767,7 @@ async def _restart_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1914,7 +1919,7 @@ async def begin_restart( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -1973,7 +1978,7 @@ async def _start_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2125,7 +2130,7 @@ async def begin_start( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -2184,7 +2189,7 @@ async def _redeploy_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2339,7 +2344,7 @@ async def begin_redeploy( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -2398,7 +2403,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2559,7 +2564,7 @@ async def begin_perform_maintenance( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -2618,7 +2623,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2767,7 +2772,7 @@ async def begin_update_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -2826,7 +2831,7 @@ async def _reimage_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2982,7 +2987,7 @@ async def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -3041,7 +3046,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3196,7 +3201,7 @@ async def begin_reimage_all( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -3267,7 +3272,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3397,7 +3402,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py index 3e19fa0aa718..8ae6a0aaaaa5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py index fb01a1949ff1..8ef363e4dc32 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -53,6 +54,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -178,7 +183,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -338,7 +343,7 @@ async def begin_capture( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -397,7 +402,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -552,7 +557,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -609,7 +614,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -764,7 +769,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -821,7 +826,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -874,7 +879,7 @@ async def begin_delete(self, resource_group_name: str, vm_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -914,7 +919,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -941,7 +946,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1002,7 +1007,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1050,7 +1055,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1106,7 +1111,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1158,7 +1163,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1212,7 +1217,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1276,7 +1281,7 @@ async def generalize( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1322,7 +1327,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1404,7 +1409,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1491,7 +1496,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1574,7 +1579,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1635,7 +1640,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1688,7 +1693,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1741,7 +1746,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1793,7 +1798,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1846,7 +1851,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1898,7 +1903,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1951,7 +1956,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2007,7 +2012,7 @@ async def _reimage_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2157,7 +2162,7 @@ async def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -2212,7 +2217,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2267,7 +2272,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2319,7 +2324,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2472,7 +2477,7 @@ async def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py index fbc6a5e253ba..c28c4949ed89 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -101,8 +106,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py index e15c2c436dc4..2caf8d24e164 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py index 44f539af3e63..d24910d4a52d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +332,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -467,7 +472,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -539,7 +544,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ def get(self, resource_group_name: str, host_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -642,7 +647,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -723,7 +728,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py index 620c5d1369a5..a8979fdb550b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,13 +145,13 @@ def build_get_request( host_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -795,7 +800,7 @@ def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -825,7 +830,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -880,7 +885,7 @@ def list_by_host_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py index ab9a1e6db9eb..929e17a6c354 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py index e84463d31aa1..b0165ea96139 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_get_request(resource_group_name: str, gallery_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +222,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -377,7 +382,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -444,7 +449,7 @@ def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -492,7 +497,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -545,7 +550,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -597,7 +602,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -677,7 +682,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py index b8b19f8edd19..691a8e3e6d1e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -94,7 +99,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +176,7 @@ def build_list_by_gallery_application_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -236,7 +241,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -437,7 +442,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -524,7 +529,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -580,7 +585,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -649,7 +654,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -713,7 +718,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py index b8ba99d2c347..6620f4d240b7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_list_by_gallery_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -389,7 +394,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -463,7 +468,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -512,7 +517,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -572,7 +577,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -630,7 +635,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py index 8463d2141e90..f4e75520b55d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,7 +170,7 @@ def build_list_by_gallery_image_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,7 +235,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -429,7 +434,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -572,7 +577,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -641,7 +646,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -704,7 +709,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py index 079c73a12d57..41e868736cee 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ def build_list_by_gallery_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -386,7 +391,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -459,7 +464,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -508,7 +513,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -567,7 +572,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -625,7 +630,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py index 8613b45d6ffe..38285b0a1a2f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py index 2342f021cc95..758ae590bd6e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py index 363de76781ee..35371e993f12 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py index 9e858cfd94a4..a261b37b4065 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -141,7 +146,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -333,7 +338,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -475,7 +480,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -547,7 +552,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -603,7 +608,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -651,7 +656,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -736,7 +741,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py index 13c0e7a0050a..c217f374a64e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py index 245c934a0dc1..c64ff1e80461 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py index f42a70491158..353c1e316e5b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py index dcba6858471d..6cbd034f42c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py index 7b837d005875..bff84a86d558 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py index 3f2208178cb2..ec996520c0d4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py index 4b1f054c85b0..0bb938a5e533 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -111,7 +116,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +150,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -384,7 +389,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -442,7 +447,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -501,7 +506,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -575,7 +580,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -631,7 +636,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 935afb823e94..65c4bf707477 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py index 3a8edeecaa0d..983d8a2392b8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,13 +194,13 @@ def build_get_request( instance_id: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -229,7 +234,7 @@ def build_get_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +273,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +317,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -340,7 +345,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -366,7 +371,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -392,7 +397,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -418,7 +423,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -445,7 +450,7 @@ def build_run_command_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -512,7 +517,7 @@ def _reimage_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -674,7 +679,7 @@ def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -730,7 +735,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -789,7 +794,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -842,7 +847,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -902,7 +907,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -960,7 +965,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1134,7 +1139,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1192,7 +1197,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1250,7 +1255,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1295,7 +1300,7 @@ def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -1325,7 +1330,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1389,7 +1394,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1460,7 +1465,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1551,7 +1556,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1621,7 +1626,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1675,7 +1680,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1733,7 +1738,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1786,7 +1791,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1844,7 +1849,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1897,7 +1902,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1956,7 +1961,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2009,7 +2014,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2067,7 +2072,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2125,7 +2130,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2289,7 +2294,7 @@ def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py index 9074352cf0e7..52ce8dffddc8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -382,7 +387,7 @@ def build_power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -415,7 +420,7 @@ def build_restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -446,7 +451,7 @@ def build_start_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -477,7 +482,7 @@ def build_redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -508,7 +513,7 @@ def build_perform_maintenance_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -539,7 +544,7 @@ def build_update_instances_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +575,7 @@ def build_reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -601,7 +606,7 @@ def build_reimage_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -637,7 +642,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -669,7 +674,7 @@ def build_convert_to_single_placement_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -731,7 +736,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -889,7 +894,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -950,7 +955,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1104,7 +1109,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1161,7 +1166,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1214,7 +1219,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1276,7 +1281,7 @@ def get(self, resource_group_name: str, vm_scale_set_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1328,7 +1333,7 @@ def _deallocate_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1486,7 +1491,7 @@ def begin_deallocate( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -1545,7 +1550,7 @@ def _delete_instances_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1694,7 +1699,7 @@ def begin_delete_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -1761,7 +1766,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1811,7 +1816,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1895,7 +1900,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1983,7 +1988,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2072,7 +2077,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2160,7 +2165,7 @@ def _power_off_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2334,7 +2339,7 @@ def begin_power_off( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -2394,7 +2399,7 @@ def _restart_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2546,7 +2551,7 @@ def begin_restart( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -2605,7 +2610,7 @@ def _start_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2757,7 +2762,7 @@ def begin_start( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -2816,7 +2821,7 @@ def _redeploy_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2971,7 +2976,7 @@ def begin_redeploy( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -3030,7 +3035,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3191,7 +3196,7 @@ def begin_perform_maintenance( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -3250,7 +3255,7 @@ def _update_instances_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3399,7 +3404,7 @@ def begin_update_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -3458,7 +3463,7 @@ def _reimage_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3614,7 +3619,7 @@ def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -3673,7 +3678,7 @@ def _reimage_all_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3828,7 +3833,7 @@ def begin_reimage_all( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -3899,7 +3904,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4029,7 +4034,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py index 8f5e48136f37..07aea22061a1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py index 6541ace7c001..4aeb5f266654 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -384,7 +394,7 @@ def build_list_available_sizes_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -414,7 +424,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -439,7 +449,7 @@ def build_power_off_request( def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -462,7 +472,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -485,7 +495,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -509,7 +519,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -539,7 +549,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -565,7 +575,7 @@ def build_run_command_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -627,7 +637,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -713,7 +723,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -873,7 +883,7 @@ def begin_capture( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -932,7 +942,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1084,7 +1094,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1141,7 +1151,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1293,7 +1303,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1350,7 +1360,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1403,7 +1413,7 @@ def begin_delete(self, resource_group_name: str, vm_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1443,7 +1453,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1470,7 +1480,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1531,7 +1541,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1579,7 +1589,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1633,7 +1643,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1685,7 +1695,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1739,7 +1749,7 @@ def begin_deallocate(self, resource_group_name: str, vm_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1813,7 @@ def generalize( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1848,7 +1858,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1929,7 +1939,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachine"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2015,7 +2025,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2098,7 +2108,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2159,7 +2169,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2212,7 +2222,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2265,7 +2275,7 @@ def begin_restart(self, resource_group_name: str, vm_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2317,7 +2327,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2370,7 +2380,7 @@ def begin_start(self, resource_group_name: str, vm_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2422,7 +2432,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2475,7 +2485,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2531,7 +2541,7 @@ def _reimage_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", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2681,7 +2691,7 @@ def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-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] @@ -2736,7 +2746,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2789,7 +2799,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2841,7 +2851,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2991,7 +3001,7 @@ def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) # type: Literal["2019-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py index d39313639f31..005867dddb2d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-04-01") # type: str + api_version = kwargs.pop("api_version", "2019-04-01") # type: Literal["2019-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json index 1220004ee026..7796c5b190dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json @@ -99,4 +99,4 @@ "operation_groups": { "resource_skus": "ResourceSkusOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py index 5356da17f36b..7e8602c29737 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-04-01") # type: str + api_version = kwargs.pop("api_version", "2019-04-01") # type: Literal["2019-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py index 1128e7b0656a..21abddf08259 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._resource_skus_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ 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", _params.pop("api-version", "2019-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: Literal["2019-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py index 29ea2ae61478..a94333a8ba8d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ 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", _params.pop("api-version", "2019-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: Literal["2019-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +101,7 @@ 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", _params.pop("api-version", "2019-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: Literal["2019-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py index 83d3a0b34feb..9f3a26184a84 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-07-01") # type: str + api_version = kwargs.pop("api_version", "2019-07-01") # type: Literal["2019-07-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json index 94b88b56146f..a4531282e517 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json @@ -125,4 +125,4 @@ "gallery_application_versions": "GalleryApplicationVersionsOperations", "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py index 93f0691bb86c..da01e04407cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-07-01") # type: str + api_version = kwargs.pop("api_version", "2019-07-01") # type: Literal["2019-07-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py index debe6d22f53c..70a43caa8947 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py index 05b8a59dd945..75b6a77f7cb1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ async def get(self, resource_group_name: str, host_group_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -474,7 +479,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -556,7 +561,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py index 304401fdd17a..087721369146 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -638,7 +643,7 @@ async def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -668,7 +673,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -724,7 +729,7 @@ def list_by_host_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py index 2ad80ea2a9c0..e5c67ac2920c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -247,7 +252,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -308,7 +313,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -475,7 +480,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -546,7 +551,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -594,7 +599,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -651,7 +656,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -706,7 +711,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -787,7 +792,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py index d5bf032df6e3..e67fc9a33642 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py index 248a9d3b7846..77bd05354642 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -517,7 +522,7 @@ async def get(self, resource_group_name: str, gallery_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -565,7 +570,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -670,7 +675,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -750,7 +755,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py index de66863d6baf..e472ef910e30 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py index 966a89eaebec..162f99917b56 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py index 07b9c5412b20..49ffeef7bcce 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py index a0c74f537ac8..1d216d92e97f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py index 492d44973d88..b375661e1837 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py index 97cf50200f9e..36bf638fec21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py index f7078e1b3011..559e0a505268 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py index bfcc7eaf2db3..2d878e57654e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py index 98074bacd9c3..703a61574708 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py index 07cf82201f3a..3d051ae09a45 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py index 86900146baca..d5cc7b1e8a00 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py index a38fa342bda2..bab4888b8175 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py index 7a61e6dd2383..5561a3192daf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py index e1c3d4e94113..0cc33e938636 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, 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]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index f2c87904a04f..bbd99c22715f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 827771e3575c..1b988c74817f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 08ef3fc721d5..90afa69d44c4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -260,7 +265,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -325,7 +330,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -504,7 +509,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -774,7 +779,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 71308fd82782..fe373efe0a16 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -47,6 +48,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def _reimage_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -251,7 +256,7 @@ async def begin_reimage( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -307,7 +312,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -366,7 +371,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -479,7 +484,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -537,7 +542,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -711,7 +716,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -769,7 +774,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -827,7 +832,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -872,7 +877,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -902,7 +907,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -966,7 +971,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1037,7 +1042,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1128,7 +1133,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1198,7 +1203,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1252,7 +1257,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1310,7 +1315,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1363,7 +1368,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1421,7 +1426,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1479,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1533,7 +1538,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1586,7 +1591,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1645,7 +1650,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1703,7 +1708,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -1870,7 +1875,7 @@ async def begin_run_command( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py index 428717cb8e6e..19d53a2924a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -54,6 +55,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -253,7 +258,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +319,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -468,7 +473,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -525,7 +530,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -580,7 +585,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -644,7 +649,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -696,7 +701,7 @@ async def _deallocate_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -854,7 +859,7 @@ async def begin_deallocate( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -913,7 +918,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1062,7 +1067,7 @@ async def begin_delete_instances( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -1129,7 +1134,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1179,7 +1184,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1263,7 +1268,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1351,7 +1356,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1440,7 +1445,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1528,7 +1533,7 @@ async def _power_off_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1702,7 +1707,7 @@ async def begin_power_off( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -1762,7 +1767,7 @@ async def _restart_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1914,7 +1919,7 @@ async def begin_restart( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -1973,7 +1978,7 @@ async def _start_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2125,7 +2130,7 @@ async def begin_start( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -2184,7 +2189,7 @@ async def _redeploy_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2339,7 +2344,7 @@ async def begin_redeploy( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -2398,7 +2403,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2559,7 +2564,7 @@ async def begin_perform_maintenance( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -2618,7 +2623,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2767,7 +2772,7 @@ async def begin_update_instances( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -2826,7 +2831,7 @@ async def _reimage_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2982,7 +2987,7 @@ async def begin_reimage( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -3041,7 +3046,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3196,7 +3201,7 @@ async def begin_reimage_all( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -3267,7 +3272,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3397,7 +3402,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py index 4b33c0c7976f..b507f400da46 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py index 835eff2b30e7..cc21b9d11780 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -54,6 +55,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,7 +98,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -179,7 +184,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -339,7 +344,7 @@ async def begin_capture( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -398,7 +403,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -556,7 +561,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -613,7 +618,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -878,7 +883,7 @@ async def begin_delete(self, resource_group_name: str, vm_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -918,7 +923,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -945,7 +950,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1006,7 +1011,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1054,7 +1059,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1114,7 +1119,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1166,7 +1171,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1220,7 +1225,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1289,7 +1294,7 @@ async def generalize( # 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1335,7 +1340,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1420,7 +1425,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1508,7 +1513,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1591,7 +1596,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1652,7 +1657,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1705,7 +1710,7 @@ async def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1758,7 +1763,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1810,7 +1815,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1863,7 +1868,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1915,7 +1920,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1968,7 +1973,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2020,7 +2025,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2073,7 +2078,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2129,7 +2134,7 @@ async def _reimage_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2279,7 +2284,7 @@ async def begin_reimage( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -2334,7 +2339,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2390,7 +2395,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2442,7 +2447,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2595,7 +2600,7 @@ async def begin_run_command( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py index 2ba8c9de33af..36b375ba1f21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -101,8 +106,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py index 057babf218d1..3857ab385532 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py index 97287814af9e..e96e6f17d539 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +332,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -467,7 +472,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -539,7 +544,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ def get(self, resource_group_name: str, host_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -642,7 +647,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -723,7 +728,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py index 70924734df4f..78169a0e4d20 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,13 +145,13 @@ def build_get_request( host_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -795,7 +800,7 @@ def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -825,7 +830,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -880,7 +885,7 @@ def list_by_host_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py index 4bb58f5eeb20..006af850984e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +262,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -421,7 +426,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -646,7 +651,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -715,7 +720,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -818,7 +823,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -870,7 +875,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -950,7 +955,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py index ebe03be6cf1b..0974bba3b135 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py index 67600588178c..2f3f511b27ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, gallery_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -411,7 +416,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -468,7 +473,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -619,7 +624,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -734,7 +739,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -839,7 +844,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -919,7 +924,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py index d5d68ed846fb..b490f843e676 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py index 408575e3c7cc..4aa954f76720 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py index 2f932abc150e..ac335377f0fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py index 518315f7b0c3..ab72d74aae48 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py index b6e6e0d0ef0c..910be164dfb7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py index 15931016cfb9..a15213b3ce12 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py index 3a858d68645a..1119d3a1ba47 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py index 52f8408e6e60..cc7f4cf2bcdd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py index bace6340be0b..7d9fa16f54c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py index 16cccadc6741..d36f52bf74ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py index 1d2c2bb279a7..de4983a6f4f4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py index c2162ec214ea..448df2fd1615 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py index 1b0d3a79bd90..da144350e510 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py index b8160dd8c22a..21c3ba42dfba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py index 28fc2c1b1580..99ec350bbc9d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 615f73c1748a..77d240f4afc3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index e19396d16ea8..b26f29c828ee 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -524,7 +529,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -703,7 +708,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -762,7 +767,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -823,7 +828,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -973,7 +978,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py index f65a48576ab6..cd8a4b314280 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,13 +194,13 @@ def build_get_request( instance_id: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -229,7 +234,7 @@ def build_get_instance_view_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +273,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +317,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -340,7 +345,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -366,7 +371,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -392,7 +397,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -418,7 +423,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -445,7 +450,7 @@ def build_run_command_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -512,7 +517,7 @@ def _reimage_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -674,7 +679,7 @@ def begin_reimage( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -730,7 +735,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -789,7 +794,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -842,7 +847,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -902,7 +907,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -960,7 +965,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1134,7 +1139,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1192,7 +1197,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1250,7 +1255,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1295,7 +1300,7 @@ def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -1325,7 +1330,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1389,7 +1394,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1460,7 +1465,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1551,7 +1556,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1621,7 +1626,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1675,7 +1680,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1733,7 +1738,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1786,7 +1791,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1844,7 +1849,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1897,7 +1902,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1956,7 +1961,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2009,7 +2014,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2068,7 +2073,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2126,7 +2131,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2290,7 +2295,7 @@ def begin_run_command( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py index eadf209488c9..e1e296c6c92f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -382,7 +387,7 @@ def build_power_off_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -415,7 +420,7 @@ def build_restart_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -446,7 +451,7 @@ def build_start_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -477,7 +482,7 @@ def build_redeploy_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -508,7 +513,7 @@ def build_perform_maintenance_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -539,7 +544,7 @@ def build_update_instances_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +575,7 @@ def build_reimage_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -601,7 +606,7 @@ def build_reimage_all_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -637,7 +642,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -669,7 +674,7 @@ def build_convert_to_single_placement_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -731,7 +736,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -889,7 +894,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -950,7 +955,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1104,7 +1109,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1161,7 +1166,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1214,7 +1219,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1276,7 +1281,7 @@ def get(self, resource_group_name: str, vm_scale_set_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1328,7 +1333,7 @@ def _deallocate_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1486,7 +1491,7 @@ def begin_deallocate( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -1545,7 +1550,7 @@ def _delete_instances_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1694,7 +1699,7 @@ def begin_delete_instances( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -1761,7 +1766,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1811,7 +1816,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1895,7 +1900,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1983,7 +1988,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2072,7 +2077,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2160,7 +2165,7 @@ def _power_off_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2334,7 +2339,7 @@ def begin_power_off( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -2394,7 +2399,7 @@ def _restart_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2546,7 +2551,7 @@ def begin_restart( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -2605,7 +2610,7 @@ def _start_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2757,7 +2762,7 @@ def begin_start( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -2816,7 +2821,7 @@ def _redeploy_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2971,7 +2976,7 @@ def begin_redeploy( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -3030,7 +3035,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3191,7 +3196,7 @@ def begin_perform_maintenance( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -3250,7 +3255,7 @@ def _update_instances_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3399,7 +3404,7 @@ def begin_update_instances( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -3458,7 +3463,7 @@ def _reimage_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3614,7 +3619,7 @@ def begin_reimage( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -3673,7 +3678,7 @@ def _reimage_all_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3828,7 +3833,7 @@ def begin_reimage_all( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -3899,7 +3904,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4029,7 +4034,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py index cb2a0cc41f24..47dceb400334 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py index 2b8c2da3dd62..7be6c6459342 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -386,7 +396,7 @@ def build_list_available_sizes_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -416,7 +426,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -442,7 +452,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -470,7 +480,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -493,7 +503,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -516,7 +526,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -540,7 +550,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +580,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -596,7 +606,7 @@ def build_run_command_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -658,7 +668,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -744,7 +754,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -904,7 +914,7 @@ def begin_capture( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -963,7 +973,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1118,7 +1128,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1175,7 +1185,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1327,7 +1337,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1384,7 +1394,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1437,7 +1447,7 @@ def begin_delete(self, resource_group_name: str, vm_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1477,7 +1487,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1504,7 +1514,7 @@ 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1565,7 +1575,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1613,7 +1623,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1671,7 +1681,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1723,7 +1733,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1777,7 +1787,7 @@ def begin_deallocate(self, resource_group_name: str, vm_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1846,7 +1856,7 @@ def generalize( # 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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1891,7 +1901,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1975,7 +1985,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2062,7 +2072,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2145,7 +2155,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2206,7 +2216,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2259,7 +2269,7 @@ def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2312,7 +2322,7 @@ def begin_reapply(self, resource_group_name: str, vm_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2364,7 +2374,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2417,7 +2427,7 @@ def begin_restart(self, resource_group_name: str, vm_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2469,7 +2479,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2522,7 +2532,7 @@ def begin_start(self, resource_group_name: str, vm_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2574,7 +2584,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2627,7 +2637,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2683,7 +2693,7 @@ def _reimage_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", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2833,7 +2843,7 @@ def begin_reimage( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-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] @@ -2888,7 +2898,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2942,7 +2952,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2994,7 +3004,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3144,7 +3154,7 @@ def begin_run_command( _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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) # type: Literal["2019-07-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py index 5e5f62ae39b2..dd548de401d7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-11-01") # type: str + api_version = kwargs.pop("api_version", "2019-11-01") # type: Literal["2019-11-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json index f82e8c845be1..153505da61da 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json @@ -101,4 +101,4 @@ "snapshots": "SnapshotsOperations", "disk_encryption_sets": "DiskEncryptionSetsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py index 2d5691f5f007..a80189873f21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-11-01") # type: str + api_version = kwargs.pop("api_version", "2019-11-01") # type: Literal["2019-11-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py index 981b87074dc4..13554fd5bdf0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -247,7 +252,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -308,7 +313,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -475,7 +480,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -546,7 +551,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -594,7 +599,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -651,7 +656,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -706,7 +711,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -787,7 +792,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py index 101ac4362e1f..4d2df9e8c677 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py index 557ee4c638b9..2b595bb69c63 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py index 787709ac4661..e41b2a699986 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +262,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -421,7 +426,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -646,7 +651,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -715,7 +720,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -818,7 +823,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -870,7 +875,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -950,7 +955,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py index c2eacfdb0201..848d650d6a40 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py index 4208a94c3927..fcda27f5598f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: Literal["2019-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py index 52e3e7fa3ce5..2c6e9fa74b5a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-12-01") # type: str + api_version = kwargs.pop("api_version", "2019-12-01") # type: Literal["2019-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json index 0511985e4235..c50105de83ee 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json @@ -123,4 +123,4 @@ "gallery_applications": "GalleryApplicationsOperations", "gallery_application_versions": "GalleryApplicationVersionsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py index ae53f2144c3d..b0eb825a9953 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-12-01") # type: str + api_version = kwargs.pop("api_version", "2019-12-01") # type: Literal["2019-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py index 7ecf15c1b560..a00fe0a73120 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py index 596c1e2c8606..a01728c51cd8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -422,7 +427,7 @@ async def get(self, resource_group_name: str, host_group_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -474,7 +479,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -556,7 +561,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py index 871a1df7e0c7..3d39dcf7afa8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -638,7 +643,7 @@ async def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -668,7 +673,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -724,7 +729,7 @@ def list_by_host_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py index 20f0cc27ab66..21ccb343242b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -517,7 +522,7 @@ async def get(self, resource_group_name: str, gallery_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -565,7 +570,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -670,7 +675,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -750,7 +755,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py index db5842633872..f080c6149815 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py index 963e5a68a989..aff42878d68d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py index a40fb1c5edf6..88320adba95a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py index 2eb11bcfabfc..8f1535b64e7a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py index 598800cbf3b1..87d808ce1d95 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py index 3a956dfe9bf5..d8e6ef624d38 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py index fb56dbb8d35e..0ec892fa4f04 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py index c6abf7dc0701..e69628b0bd67 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py index 7e900d02278c..c2df8a8780d2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py index 9f8f663afb3a..5ea95bb3fe80 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py index 7c713158e46a..4158b220438a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py index d48af93dddae..618fa23affe0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py index e48ec1062825..3cc99364617b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py index 18a664b11218..91921872ad7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_run_commands_operations import build_get_request, 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]] @@ -69,7 +74,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -161,7 +166,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index a9347f1f285b..a3de252f9645 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 7f9000e3944b..51b4b3cad01a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 53bfb0dcd871..4682290c0881 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -260,7 +265,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -325,7 +330,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -504,7 +509,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -774,7 +779,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 2edbb16308f9..9f5a263bef7e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -48,6 +49,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ async def _reimage_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -252,7 +257,7 @@ async def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -308,7 +313,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -367,7 +372,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -420,7 +425,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -480,7 +485,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -538,7 +543,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -712,7 +717,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -770,7 +775,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -828,7 +833,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -873,7 +878,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -903,7 +908,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -967,7 +972,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1038,7 +1043,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1129,7 +1134,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1199,7 +1204,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1253,7 +1258,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1311,7 +1316,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1364,7 +1369,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1422,7 +1427,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1475,7 +1480,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1534,7 +1539,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1587,7 +1592,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1646,7 +1651,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1714,7 +1719,7 @@ async def simulate_eviction( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1764,7 +1769,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -1931,7 +1936,7 @@ async def begin_run_command( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py index 883db3fcede2..4d0162fdd1f8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -55,6 +56,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -254,7 +259,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -469,7 +474,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -526,7 +531,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -581,7 +586,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -645,7 +650,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -697,7 +702,7 @@ async def _deallocate_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -855,7 +860,7 @@ async def begin_deallocate( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -914,7 +919,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1063,7 +1068,7 @@ async def begin_delete_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -1130,7 +1135,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1180,7 +1185,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1264,7 +1269,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1352,7 +1357,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1441,7 +1446,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1529,7 +1534,7 @@ async def _power_off_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1703,7 +1708,7 @@ async def begin_power_off( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -1763,7 +1768,7 @@ async def _restart_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1915,7 +1920,7 @@ async def begin_restart( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -1974,7 +1979,7 @@ async def _start_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2126,7 +2131,7 @@ async def begin_start( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -2185,7 +2190,7 @@ async def _redeploy_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2340,7 +2345,7 @@ async def begin_redeploy( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -2399,7 +2404,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2560,7 +2565,7 @@ async def begin_perform_maintenance( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -2619,7 +2624,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2768,7 +2773,7 @@ async def begin_update_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -2827,7 +2832,7 @@ async def _reimage_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2983,7 +2988,7 @@ async def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -3042,7 +3047,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3197,7 +3202,7 @@ async def begin_reimage_all( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -3268,7 +3273,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3398,7 +3403,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3458,7 +3463,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3606,7 +3611,7 @@ async def begin_set_orchestration_service_state( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py index a4ce3420f3e8..2261c1f3ba07 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py index bf3f34042c06..c219da15128e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -55,6 +56,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -180,7 +185,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -340,7 +345,7 @@ async def begin_capture( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -399,7 +404,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -557,7 +562,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -614,7 +619,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -769,7 +774,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -826,7 +831,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -879,7 +884,7 @@ async def begin_delete(self, resource_group_name: str, vm_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -919,7 +924,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -946,7 +951,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1007,7 +1012,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1055,7 +1060,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1115,7 +1120,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1167,7 +1172,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1221,7 +1226,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1290,7 +1295,7 @@ async def generalize( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1336,7 +1341,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1421,7 +1426,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1509,7 +1514,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1592,7 +1597,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1653,7 +1658,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1706,7 +1711,7 @@ async def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1759,7 +1764,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1811,7 +1816,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1864,7 +1869,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1916,7 +1921,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1969,7 +1974,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2021,7 +2026,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2074,7 +2079,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2130,7 +2135,7 @@ async def _reimage_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2280,7 +2285,7 @@ async def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -2335,7 +2340,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2391,7 +2396,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2456,7 +2461,7 @@ async def simulate_eviction( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2500,7 +2505,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2653,7 +2658,7 @@ async def begin_run_command( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py index ad85fa615e8b..bd03113b87c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -78,8 +83,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py index 912fde852f0b..c6c3e6eb8b6b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py index 0e7c20557385..0a08debc9a2b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +332,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -467,7 +472,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -539,7 +544,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ def get(self, resource_group_name: str, host_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -642,7 +647,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -723,7 +728,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py index f4847ebd541a..af98da4f37a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,13 +145,13 @@ def build_get_request( host_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -795,7 +800,7 @@ def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -825,7 +830,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -880,7 +885,7 @@ def list_by_host_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py index 55ac0d3fb6e7..019f900b0acd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, gallery_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -411,7 +416,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -468,7 +473,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -619,7 +624,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def get(self, resource_group_name: str, gallery_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -734,7 +739,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -839,7 +844,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -919,7 +924,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py index 225be80b3133..99a2fb9fe043 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py index a0855d8c40a3..85fc65cd171e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py index 8c7911ba76f5..b411f65fc807 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py index 7efda3445eaf..44060bdb405a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py index 318a143b47da..7679cc194f37 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py index c6ccc29951b1..ad7a7f510d0e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py index 20d74b3b589e..2f348fd7b938 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py index 48f0ad2bd621..295662659512 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py index 9baeaba28599..030c6a184b16 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py index 4ff36f8f42df..3c8f096a9e38 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py index 27c109150bef..846022c96f06 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py index daf9be53d302..086a9fdd2eeb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py index 7120cce58465..490a575542c3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py index 692346ce1575..70e13ee98d9a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -67,7 +72,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -127,7 +132,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -219,7 +224,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py index 99ebebdab871..6713d0932121 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 8111b2fdf53b..92871b95b5d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 3e22207533a1..0f2aaf1c3b94 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -524,7 +529,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -703,7 +708,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -762,7 +767,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -823,7 +828,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -973,7 +978,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py index 950e63101b54..1bf458f8fab3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,13 +194,13 @@ def build_get_request( instance_id: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -229,7 +234,7 @@ def build_get_instance_view_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +273,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +317,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -340,7 +345,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -366,7 +371,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -392,7 +397,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -418,7 +423,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -444,7 +449,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -471,7 +476,7 @@ def build_run_command_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -538,7 +543,7 @@ def _reimage_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -700,7 +705,7 @@ def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -756,7 +761,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -815,7 +820,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -868,7 +873,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -928,7 +933,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -986,7 +991,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1160,7 +1165,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1218,7 +1223,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1276,7 +1281,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1321,7 +1326,7 @@ def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -1351,7 +1356,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1415,7 +1420,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1486,7 +1491,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1577,7 +1582,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1647,7 +1652,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1701,7 +1706,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1759,7 +1764,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1812,7 +1817,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1870,7 +1875,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1923,7 +1928,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1982,7 +1987,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2035,7 +2040,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2094,7 +2099,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2162,7 +2167,7 @@ def simulate_eviction( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2212,7 +2217,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2376,7 +2381,7 @@ def begin_run_command( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py index cb25f86f7823..db05bdb98e9c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -382,7 +387,7 @@ def build_power_off_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -415,7 +420,7 @@ def build_restart_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -446,7 +451,7 @@ def build_start_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -477,7 +482,7 @@ def build_redeploy_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -508,7 +513,7 @@ def build_perform_maintenance_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -539,7 +544,7 @@ def build_update_instances_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +575,7 @@ def build_reimage_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -601,7 +606,7 @@ def build_reimage_all_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -637,7 +642,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -669,7 +674,7 @@ def build_convert_to_single_placement_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -700,7 +705,7 @@ def build_set_orchestration_service_state_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -762,7 +767,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -920,7 +925,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -981,7 +986,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1135,7 +1140,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1192,7 +1197,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1245,7 +1250,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1307,7 +1312,7 @@ def get(self, resource_group_name: str, vm_scale_set_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1359,7 +1364,7 @@ def _deallocate_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1517,7 +1522,7 @@ def begin_deallocate( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -1576,7 +1581,7 @@ def _delete_instances_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1725,7 +1730,7 @@ def begin_delete_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -1792,7 +1797,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1842,7 +1847,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1926,7 +1931,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2014,7 +2019,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2103,7 +2108,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2191,7 +2196,7 @@ def _power_off_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2365,7 +2370,7 @@ def begin_power_off( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -2425,7 +2430,7 @@ def _restart_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2577,7 +2582,7 @@ def begin_restart( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -2636,7 +2641,7 @@ def _start_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2788,7 +2793,7 @@ def begin_start( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -2847,7 +2852,7 @@ def _redeploy_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3002,7 +3007,7 @@ def begin_redeploy( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -3061,7 +3066,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3222,7 +3227,7 @@ def begin_perform_maintenance( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -3281,7 +3286,7 @@ def _update_instances_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3430,7 +3435,7 @@ def begin_update_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -3489,7 +3494,7 @@ def _reimage_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3645,7 +3650,7 @@ def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -3704,7 +3709,7 @@ def _reimage_all_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3859,7 +3864,7 @@ def begin_reimage_all( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -3930,7 +3935,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4060,7 +4065,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4120,7 +4125,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4268,7 +4273,7 @@ def begin_set_orchestration_service_state( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py index beab47040534..80a887a78d83 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py index 1cd8945ebc71..c2f6cf9da535 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_update_request(resource_group_name: str, vm_name: str, subscription_id def build_delete_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -188,12 +193,17 @@ def build_delete_request(resource_group_name: str, vm_name: str, subscription_id def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +236,7 @@ def build_instance_view_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +266,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -281,7 +291,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -306,7 +316,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -330,7 +340,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +368,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -386,7 +396,7 @@ def build_list_available_sizes_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -416,7 +426,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -442,7 +452,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -470,7 +480,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -493,7 +503,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -516,7 +526,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -540,7 +550,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +580,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -595,7 +605,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -621,7 +631,7 @@ def build_run_command_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -683,7 +693,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -769,7 +779,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -929,7 +939,7 @@ def begin_capture( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -988,7 +998,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1143,7 +1153,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1200,7 +1210,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1352,7 +1362,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1409,7 +1419,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1462,7 +1472,7 @@ def begin_delete(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1502,7 +1512,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1529,7 +1539,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1590,7 +1600,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1638,7 +1648,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1696,7 +1706,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1748,7 +1758,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1802,7 +1812,7 @@ def begin_deallocate(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1871,7 +1881,7 @@ def generalize( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1916,7 +1926,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2000,7 +2010,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2087,7 +2097,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2170,7 +2180,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2231,7 +2241,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2284,7 +2294,7 @@ def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2337,7 +2347,7 @@ def begin_reapply(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2389,7 +2399,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2442,7 +2452,7 @@ def begin_restart(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2494,7 +2504,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2547,7 +2557,7 @@ def begin_start(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2599,7 +2609,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2652,7 +2662,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2708,7 +2718,7 @@ def _reimage_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", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2858,7 +2868,7 @@ def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-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] @@ -2913,7 +2923,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2967,7 +2977,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3032,7 +3042,7 @@ def simulate_eviction( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3076,7 +3086,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3226,7 +3236,7 @@ def begin_run_command( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-12-01")) # type: Literal["2019-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py index 5d707da9e71d..59e9a04badf4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-05-01") # type: str + api_version = kwargs.pop("api_version", "2020-05-01") # type: Literal["2020-05-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json index fae998f23ae1..8e3dde8fa19f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json @@ -102,4 +102,4 @@ "disk_encryption_sets": "DiskEncryptionSetsOperations", "disk_accesses": "DiskAccessesOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py index f0d142f8e5e6..a47a8d62d634 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-05-01") # type: str + api_version = kwargs.pop("api_version", "2020-05-01") # type: Literal["2020-05-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py index 7c5e2a3214ba..732aa7442c37 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -237,7 +242,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -298,7 +303,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -462,7 +467,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -531,7 +536,7 @@ async def get(self, resource_group_name: str, disk_access_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -579,7 +584,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -636,7 +641,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -689,7 +694,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -770,7 +775,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -865,7 +870,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py index 90061c854666..eca4e46184bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -247,7 +252,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -308,7 +313,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -475,7 +480,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -546,7 +551,7 @@ 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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -594,7 +599,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -651,7 +656,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -706,7 +711,7 @@ 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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -787,7 +792,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py index 828f1bb385a3..c7abe2541cc8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py index 10aba2353c73..3a064b9934e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py index 90961a09f4f7..542db974b47c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +289,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -441,7 +446,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -502,7 +507,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -663,7 +668,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -732,7 +737,7 @@ def get(self, resource_group_name: str, disk_access_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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -780,7 +785,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -835,7 +840,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -887,7 +892,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -967,7 +972,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1062,7 +1067,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py index b9e39c64214f..f2cd60868496 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +262,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -421,7 +426,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -646,7 +651,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -715,7 +720,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -818,7 +823,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -870,7 +875,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -950,7 +955,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py index 46c52954a097..f4d17b47fd6f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py index 1aaea228b501..4a374ee095a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) # type: Literal["2020-05-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py index 7fd4c69c4191..f8a1a05de446 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-06-01") # type: str + api_version = kwargs.pop("api_version", "2020-06-01") # type: Literal["2020-06-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json index 605e288ca50d..dac57db865c8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json @@ -119,4 +119,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py index 111130a388f4..1a01ece54139 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-06-01") # type: str + api_version = kwargs.pop("api_version", "2020-06-01") # type: Literal["2020-06-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py index 951b841db989..1314dd0fef2a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py index 4a777a048ec9..73b2274f3c22 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -400,7 +405,11 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, host_group_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + host_group_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> _models.DedicatedHostGroup: """Retrieves information about a dedicated host group. @@ -428,7 +437,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -481,7 +490,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -563,7 +572,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py index 389f1a6f1dd4..364696277b91 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -638,7 +643,7 @@ async def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -668,7 +673,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -724,7 +729,7 @@ def list_by_host_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py index c94208f8ed0e..5be1761e2f91 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py index 69e847941d5e..46388ca88c64 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py index ec003454dc83..5b0f03ab8cd4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py index 7f282186952b..6c571d583f54 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py index 605681bfe697..28d224df8d19 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py index f6aea57b4072..461d96286ea1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py index 04bef1c95b74..fc0ebf0dcea0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py index 628634e75bb6..d01966b3a47d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py index cabf0c4a4530..c71ce634bfb4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py index 6a83659c4f76..0db69908f0d9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 9c484aa54c16..ac0323059140 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 870f9b0e6143..ad2cd7630708 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 9a564c859a1c..00be821c04f1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index cbd11ff7e46b..683fb068a9cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 5eede6cbd4e5..9d30a3b994d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -771,7 +776,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -829,7 +834,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -874,7 +879,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -904,7 +909,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -968,7 +973,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1039,7 +1044,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1130,7 +1135,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1200,7 +1205,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1254,7 +1259,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1312,7 +1317,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1365,7 +1370,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1423,7 +1428,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1476,7 +1481,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1535,7 +1540,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1612,7 +1617,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1662,7 +1667,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1720,7 +1725,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1787,7 +1792,7 @@ async def simulate_eviction( # 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1837,7 +1842,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2004,7 +2009,7 @@ async def begin_run_command( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py index b9f22aceab19..033a8ef15c07 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -55,6 +56,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -254,7 +259,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -469,7 +474,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -526,7 +531,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -581,7 +586,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -645,7 +650,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -697,7 +702,7 @@ async def _deallocate_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -855,7 +860,7 @@ async def begin_deallocate( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -914,7 +919,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1063,7 +1068,7 @@ async def begin_delete_instances( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -1130,7 +1135,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1180,7 +1185,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1264,7 +1269,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1352,7 +1357,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1441,7 +1446,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1529,7 +1534,7 @@ async def _power_off_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1703,7 +1708,7 @@ async def begin_power_off( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -1763,7 +1768,7 @@ async def _restart_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1915,7 +1920,7 @@ async def begin_restart( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -1974,7 +1979,7 @@ async def _start_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2126,7 +2131,7 @@ async def begin_start( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -2185,7 +2190,7 @@ async def _redeploy_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2340,7 +2345,7 @@ async def begin_redeploy( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -2399,7 +2404,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2560,7 +2565,7 @@ async def begin_perform_maintenance( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -2619,7 +2624,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2768,7 +2773,7 @@ async def begin_update_instances( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -2827,7 +2832,7 @@ async def _reimage_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2983,7 +2988,7 @@ async def begin_reimage( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -3042,7 +3047,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3197,7 +3202,7 @@ async def begin_reimage_all( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -3268,7 +3273,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3398,7 +3403,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3458,7 +3463,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3606,7 +3611,7 @@ async def begin_set_orchestration_service_state( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py index 92f2f112c840..9b858dc5d615 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py index 88c40e804fc0..7598f5f94c53 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -57,6 +58,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -182,7 +187,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -342,7 +347,7 @@ async def begin_capture( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -559,7 +564,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -616,7 +621,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -771,7 +776,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -828,7 +833,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -887,7 +892,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -928,7 +933,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -955,7 +960,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1016,7 +1021,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1064,7 +1069,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1120,7 +1125,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1172,7 +1177,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1226,7 +1231,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1295,7 +1300,7 @@ async def generalize( # 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1341,7 +1346,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1426,7 +1431,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1514,7 +1519,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1597,7 +1602,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1658,7 +1663,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1711,7 +1716,7 @@ async def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1764,7 +1769,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1816,7 +1821,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1869,7 +1874,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1921,7 +1926,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1974,7 +1979,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2026,7 +2031,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2079,7 +2084,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2135,7 +2140,7 @@ async def _reimage_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2285,7 +2290,7 @@ async def begin_reimage( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -2360,7 +2365,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2409,7 +2414,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2464,7 +2469,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2528,7 +2533,7 @@ async def simulate_eviction( # 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2572,7 +2577,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2635,7 +2640,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2691,7 +2696,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2844,7 +2849,7 @@ async def begin_run_command( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py index 39fd1cbf3e7a..ef68d4531b60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -78,8 +83,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py index e005cb72493c..db1e129a7b0f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py index 6f7e93867f7b..64ccd22f765f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -130,12 +135,17 @@ def build_delete_request( def build_get_request( - resource_group_name: str, host_group_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + host_group_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +176,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +204,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -329,7 +339,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -469,7 +479,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -541,7 +551,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -573,7 +583,11 @@ def delete( # pylint: disable=inconsistent-return-statements @distributed_trace def get( - self, resource_group_name: str, host_group_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + host_group_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> _models.DedicatedHostGroup: """Retrieves information about a dedicated host group. @@ -601,7 +615,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -651,7 +665,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -732,7 +746,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py index 9871114c1a4b..2fcacc0785ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,13 +145,13 @@ def build_get_request( host_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -795,7 +800,7 @@ def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -825,7 +830,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -880,7 +885,7 @@ def list_by_host_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py index 01d9c3e9efff..1da7a8063c9b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py index 6d40b0611e0c..33c60899bf0b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py index da5357698905..7543ba630c6c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py index 78aa3adcf07b..f648860fd87b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py index 89edd43e4440..566ea115c888 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py index 53309ba22e1f..2ca486fb8e37 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py index 4e8eae53a634..d40ac654b430 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py index 10faacd39db7..efc56b095251 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py index f97fa12ac4ca..ec38133eecf9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py index f41a1e04e090..1a8ec32d9896 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py index 15c5cbabbf63..84019fae6805 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 02f5dbf64f87..9a0b72b1a788 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 65947e90d134..8f4d982d2a93 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 4d687c5f32e4..11dda2a6848c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py index 0d5ba83e0c3e..7ba1e42037d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -189,13 +194,13 @@ def build_get_request( instance_id: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -229,7 +234,7 @@ def build_get_instance_view_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +273,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +317,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -340,7 +345,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -366,7 +371,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -392,7 +397,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -425,7 +430,7 @@ def build_retrieve_boot_diagnostics_data_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -460,7 +465,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -486,7 +491,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -513,7 +518,7 @@ def build_run_command_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -580,7 +585,7 @@ def _reimage_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -742,7 +747,7 @@ def begin_reimage( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -798,7 +803,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -857,7 +862,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -910,7 +915,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -970,7 +975,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1028,7 +1033,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1202,7 +1207,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1260,7 +1265,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1318,7 +1323,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1363,7 +1368,7 @@ def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -1393,7 +1398,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1457,7 +1462,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1528,7 +1533,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1619,7 +1624,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1689,7 +1694,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1743,7 +1748,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1801,7 +1806,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1854,7 +1859,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1912,7 +1917,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1965,7 +1970,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2024,7 +2029,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2101,7 +2106,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2151,7 +2156,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2209,7 +2214,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2276,7 +2281,7 @@ def simulate_eviction( # 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2326,7 +2331,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2490,7 +2495,7 @@ def begin_run_command( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py index 9bbb6a5dc253..da154d61eb0c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -137,7 +142,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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +173,7 @@ def build_deallocate_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -199,7 +204,7 @@ def build_delete_instances_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -230,7 +235,7 @@ def build_get_instance_view_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +292,7 @@ def build_list_all_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -315,7 +320,7 @@ def build_list_skus_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -346,7 +351,7 @@ def build_get_os_upgrade_history_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -382,7 +387,7 @@ def build_power_off_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -415,7 +420,7 @@ def build_restart_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -446,7 +451,7 @@ def build_start_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -477,7 +482,7 @@ def build_redeploy_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -508,7 +513,7 @@ def build_perform_maintenance_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -539,7 +544,7 @@ def build_update_instances_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -570,7 +575,7 @@ def build_reimage_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -601,7 +606,7 @@ def build_reimage_all_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -637,7 +642,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -669,7 +674,7 @@ def build_convert_to_single_placement_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -700,7 +705,7 @@ def build_set_orchestration_service_state_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -762,7 +767,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -920,7 +925,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -981,7 +986,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1135,7 +1140,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1192,7 +1197,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1245,7 +1250,7 @@ def begin_delete(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1307,7 +1312,7 @@ def get(self, resource_group_name: str, vm_scale_set_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1359,7 +1364,7 @@ def _deallocate_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1517,7 +1522,7 @@ def begin_deallocate( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -1576,7 +1581,7 @@ def _delete_instances_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1725,7 +1730,7 @@ def begin_delete_instances( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -1792,7 +1797,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1842,7 +1847,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1926,7 +1931,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2014,7 +2019,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2103,7 +2108,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2191,7 +2196,7 @@ def _power_off_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2365,7 +2370,7 @@ def begin_power_off( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -2425,7 +2430,7 @@ def _restart_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2577,7 +2582,7 @@ def begin_restart( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -2636,7 +2641,7 @@ def _start_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2788,7 +2793,7 @@ def begin_start( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -2847,7 +2852,7 @@ def _redeploy_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3002,7 +3007,7 @@ def begin_redeploy( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -3061,7 +3066,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3222,7 +3227,7 @@ def begin_perform_maintenance( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -3281,7 +3286,7 @@ def _update_instances_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3430,7 +3435,7 @@ def begin_update_instances( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -3489,7 +3494,7 @@ def _reimage_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3645,7 +3650,7 @@ def begin_reimage( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -3704,7 +3709,7 @@ def _reimage_all_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3859,7 +3864,7 @@ def begin_reimage_all( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -3930,7 +3935,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4060,7 +4065,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4120,7 +4125,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4268,7 +4273,7 @@ def begin_set_orchestration_service_state( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py index 21ff6e900153..a79bcfc10345 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py index 409a8d080aa7..686b877e669a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -197,12 +202,17 @@ def build_delete_request( def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -235,7 +245,7 @@ def build_instance_view_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +275,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -290,7 +300,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -315,7 +325,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -339,7 +349,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -367,7 +377,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +405,7 @@ def build_list_available_sizes_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -425,7 +435,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -451,7 +461,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -479,7 +489,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -502,7 +512,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -525,7 +535,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -549,7 +559,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -585,7 +595,7 @@ def build_retrieve_boot_diagnostics_data_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -619,7 +629,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -644,7 +654,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -670,7 +680,7 @@ def build_assess_patches_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -701,7 +711,7 @@ def build_run_command_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -763,7 +773,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -849,7 +859,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1009,7 +1019,7 @@ def begin_capture( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1068,7 +1078,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1223,7 +1233,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1290,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1432,7 +1442,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1489,7 +1499,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1548,7 +1558,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1589,7 +1599,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1616,7 +1626,7 @@ 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1677,7 +1687,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1725,7 +1735,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1779,7 +1789,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1831,7 +1841,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1885,7 +1895,7 @@ def begin_deallocate(self, resource_group_name: str, vm_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1954,7 +1964,7 @@ def generalize( # 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1999,7 +2009,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2083,7 +2093,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2170,7 +2180,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2253,7 +2263,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2314,7 +2324,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2367,7 +2377,7 @@ def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2420,7 +2430,7 @@ def begin_reapply(self, resource_group_name: str, vm_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2472,7 +2482,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2525,7 +2535,7 @@ def begin_restart(self, resource_group_name: str, vm_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2577,7 +2587,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2630,7 +2640,7 @@ def begin_start(self, resource_group_name: str, vm_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2682,7 +2692,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2735,7 +2745,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2791,7 +2801,7 @@ def _reimage_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", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2941,7 +2951,7 @@ def begin_reimage( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-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] @@ -3016,7 +3026,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3065,7 +3075,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3118,7 +3128,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3182,7 +3192,7 @@ def simulate_eviction( # 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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3226,7 +3236,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3289,7 +3299,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3345,7 +3355,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3495,7 +3505,7 @@ def begin_run_command( _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-06-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: Literal["2020-06-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py index 95b096f0f69c..10fe16dc543f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-06-30") # type: str + api_version = kwargs.pop("api_version", "2020-06-30") # type: Literal["2020-06-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json index 454435f7daef..1fdd9e89758d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json @@ -102,4 +102,4 @@ "disk_encryption_sets": "DiskEncryptionSetsOperations", "disk_accesses": "DiskAccessesOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py index dd257a3e637e..3bb6b24ff175 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-06-30") # type: str + api_version = kwargs.pop("api_version", "2020-06-30") # type: Literal["2020-06-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py index ddf4a0071d00..57b5a8f0d35a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -237,7 +242,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -298,7 +303,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -462,7 +467,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -531,7 +536,7 @@ async def get(self, resource_group_name: str, disk_access_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -579,7 +584,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -636,7 +641,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -689,7 +694,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -770,7 +775,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -865,7 +870,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py index c54a63066ce1..6faa16fbe984 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ 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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py index 12b46b5e02f0..deeed6250aac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py index c2b37f9cf6e0..7c4daa33bc3f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py index 58862e406186..ab6f274a33f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +289,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -441,7 +446,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -502,7 +507,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -663,7 +668,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -732,7 +737,7 @@ def get(self, resource_group_name: str, disk_access_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -780,7 +785,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -835,7 +840,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -887,7 +892,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -967,7 +972,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1062,7 +1067,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py index bfeb6bb5ba87..0c33a797b7b7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py index 7a222413d641..1c59f1d74d49 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py index 7c09cf4388ff..637eacf1bd90 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-30")) # type: Literal["2020-06-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py index 2a5b072f3671..e00b7a6e1ffb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-09-30") # type: str + api_version = kwargs.pop("api_version", "2020-09-30") # type: Literal["2020-09-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json index b4a2878640db..441d739da6fa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json @@ -112,4 +112,4 @@ "shared_gallery_images": "SharedGalleryImagesOperations", "shared_gallery_image_versions": "SharedGalleryImageVersionsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py index e30d50c21646..b620bd0fe203 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-09-30") # type: str + api_version = kwargs.pop("api_version", "2020-09-30") # type: Literal["2020-09-30"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py index bc4f0f850404..308978b9e2c9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py index 4534e34666fb..09b98aeb0c12 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py index 2ee10335c790..4a95bf09e8bc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._disk_restore_point_operations import build_get_request, build_list_by_restore_point_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -155,7 +160,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py index 5afc7fbd5cb8..9d3acc023715 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py index 237bf0ee5bc6..169cdfe3e65c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -526,7 +531,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -575,7 +580,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -628,7 +633,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -680,7 +685,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -760,7 +765,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py index 24c470831fe0..54aafd1514b5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py index 38b0a70d3cf8..fcb7c1a61174 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py index 1da27ed48d92..1c220ff0c557 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py index 7837bba79dbf..9b4f907d6773 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py index 02f30846dbd4..e2afd62c6014 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._gallery_sharing_profile_operations import build_update_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -229,7 +234,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py index 96e35de8b706..151f000780b5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_galleries_operations import build_get_request, 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]] @@ -73,7 +78,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -166,7 +171,7 @@ async def get(self, location: str, gallery_unique_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py index 25f1ec934e79..c49ad2912a10 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_image_versions_operations import build_get_request, 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]] @@ -84,7 +89,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -194,7 +199,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py index f6d6c36b501c..a5be5056cc85 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_images_operations import build_get_request, 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]] @@ -79,7 +84,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -178,7 +183,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py index 827419cbbf14..ea8d78d89ff2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py index 33b1c2abb209..a5af7e755878 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py index c85c6e926b01..d39e6afa9ad7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py index 5d4c7e69924a..23df19106224 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +91,7 @@ def build_list_by_restore_point_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -234,7 +239,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py index 5c35d34b17d0..9c26098ce782 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py index 0756f147cbf9..779fc4a9d5f8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -117,7 +122,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +265,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -420,7 +425,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -477,7 +482,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -628,7 +633,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -704,7 +709,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -753,7 +758,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -806,7 +811,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -858,7 +863,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -938,7 +943,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py index bf984a6eb996..d55ed02f7575 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py index f60c15a6fc22..65775d853151 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py index bd35cda0ec35..42e78eb358f3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py index f2f2f4ee04d3..6f37974e910b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py index 0eda2cabcccd..f41593c77288 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -263,7 +268,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py index 953fec43bddc..6dd6c0515599 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_get_request(location: str, gallery_unique_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", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -232,7 +237,7 @@ def get(self, location: str, gallery_unique_name: 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py index e63a5d8a6644..30a1784388a2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +92,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -274,7 +279,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py index 7c2dffec8b98..1d3780a87d68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -249,7 +254,7 @@ 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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py index 1b39fa2c7247..3c9ec588d767 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-30")) # type: Literal["2020-09-30"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_configuration.py index 0918b14e2053..cd3601d87016 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-10-01-preview") # type: str + api_version = kwargs.pop("api_version", "2020-10-01-preview") # type: Literal["2020-10-01-preview"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_metadata.json index ba2c6698c1ed..423630627ef0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_metadata.json @@ -102,4 +102,4 @@ "cloud_services": "CloudServicesOperations", "cloud_services_update_domain": "CloudServicesUpdateDomainOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/_configuration.py index 33fcc9caf5cb..e4b73b5d0f67 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-10-01-preview") # type: str + api_version = kwargs.pop("api_version", "2020-10-01-preview") # type: Literal["2020-10-01-preview"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_role_instances_operations.py index 27d171d541e8..5aa666c4d207 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -41,6 +42,10 @@ build_restart_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -136,7 +143,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -181,7 +190,7 @@ async def get( role_instance_name: str, resource_group_name: str, cloud_service_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.RoleInstance: """Gets a role instance from a cloud service. @@ -211,7 +220,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -275,7 +286,9 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -312,7 +325,11 @@ async def get_instance_view( @distributed_trace def list( - self, resource_group_name: str, cloud_service_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + cloud_service_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> AsyncIterable["_models.RoleInstance"]: """Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role @@ -334,7 +351,9 @@ 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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -418,7 +437,9 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -477,7 +498,9 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -530,7 +553,9 @@ async def _reimage_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -589,7 +614,9 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -642,7 +669,9 @@ async def _rebuild_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -702,7 +731,9 @@ async def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -769,7 +800,9 @@ async def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[AsyncIterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_roles_operations.py index 46ce715ad171..594255262029 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._cloud_service_roles_operations import build_get_request, 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]] @@ -81,7 +86,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -136,7 +143,9 @@ 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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_operations.py index 3ed5f367068c..a7eddeff6b08 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,6 +47,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -252,7 +259,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +322,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -471,7 +482,9 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -528,7 +541,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -583,7 +598,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -645,7 +662,9 @@ async def get(self, resource_group_name: str, cloud_service_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -705,7 +724,9 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -754,7 +775,9 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -838,7 +861,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -920,7 +945,9 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -975,7 +1002,9 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1027,7 +1056,9 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1083,7 +1114,9 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1139,7 +1172,9 @@ async def _restart_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1287,7 +1322,9 @@ async def begin_restart( _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -1346,7 +1383,9 @@ async def _reimage_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1497,7 +1536,9 @@ async def begin_reimage( _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -1556,7 +1597,9 @@ async def _rebuild_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1710,7 +1753,9 @@ async def begin_rebuild( _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -1769,7 +1814,9 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1917,7 +1964,9 @@ async def begin_delete_instances( _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_update_domain_operations.py index a673b9ae5640..5972ae964d04 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/aio/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -36,6 +37,10 @@ build_walk_update_domain_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,9 @@ async def _walk_update_domain_initial( # pylint: disable=inconsistent-return-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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -242,7 +249,9 @@ async def begin_walk_update_domain( _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -316,7 +325,9 @@ async def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -370,7 +381,9 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_role_instances_operations.py index 19317281351e..0aef206622ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,13 +83,15 @@ def build_get_request( cloud_service_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +125,9 @@ def build_get_instance_view_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -147,13 +158,15 @@ def build_list_request( cloud_service_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +199,9 @@ def build_restart_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +233,9 @@ def build_reimage_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +267,9 @@ def build_rebuild_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +301,9 @@ def build_get_remote_desktop_file_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/x-rdp") # Construct URL @@ -341,7 +362,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -399,7 +422,9 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -444,7 +469,7 @@ def get( role_instance_name: str, resource_group_name: str, cloud_service_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.RoleInstance: """Gets a role instance from a cloud service. @@ -474,7 +499,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -538,7 +565,9 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -575,7 +604,11 @@ def get_instance_view( @distributed_trace def list( - self, resource_group_name: str, cloud_service_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + cloud_service_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> Iterable["_models.RoleInstance"]: """Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next page of role instances. Do this till nextLink is null to fetch all the role @@ -597,7 +630,9 @@ 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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -681,7 +716,9 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -740,7 +777,9 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -793,7 +832,9 @@ def _reimage_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -852,7 +893,9 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +948,9 @@ def _rebuild_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -965,7 +1010,9 @@ def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1032,7 +1079,9 @@ def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[Iterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_roles_operations.py index 673f80b39000..6912dc3fc9af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +81,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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +155,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -201,7 +212,9 @@ 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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_operations.py index aefc94672d88..c20282efff97 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +85,9 @@ 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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +121,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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +154,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +187,9 @@ def build_get_instance_view_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +218,9 @@ def build_list_all_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -227,7 +244,9 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +276,9 @@ def build_start_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +309,9 @@ def build_power_off_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +342,9 @@ def build_restart_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -353,7 +378,9 @@ def build_reimage_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -387,7 +414,9 @@ def build_rebuild_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -421,7 +450,9 @@ def build_delete_instances_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -486,7 +517,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -651,7 +684,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -712,7 +747,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -870,7 +907,9 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -927,7 +966,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -980,7 +1021,9 @@ def begin_delete(self, resource_group_name: str, cloud_service_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1085,9 @@ def get(self, resource_group_name: str, cloud_service_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -1102,7 +1147,9 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -1151,7 +1198,9 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1235,7 +1284,9 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Clo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1317,7 +1368,9 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1370,7 +1423,9 @@ def begin_start(self, resource_group_name: str, cloud_service_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1422,7 +1477,9 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1476,7 +1533,9 @@ def begin_power_off(self, resource_group_name: str, cloud_service_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1532,7 +1591,9 @@ def _restart_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1680,7 +1741,9 @@ def begin_restart( _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -1739,7 +1802,9 @@ def _reimage_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1890,7 +1955,9 @@ def begin_reimage( _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -1949,7 +2016,9 @@ def _rebuild_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2103,7 +2172,9 @@ def begin_rebuild( _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -2162,7 +2233,9 @@ def _delete_instances_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", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2310,7 +2383,9 @@ def begin_delete_instances( _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_update_domain_operations.py index ad8cd911d0a0..27f8999e19d9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,9 @@ def build_walk_update_domain_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +86,9 @@ def build_get_update_domain_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +120,9 @@ def build_list_update_domains_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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +185,9 @@ def _walk_update_domain_initial( # pylint: disable=inconsistent-return-statemen _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -338,7 +351,9 @@ def begin_walk_update_domain( _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-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-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] @@ -412,7 +427,9 @@ def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -466,7 +483,9 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01-preview")) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", "2020-10-01-preview") + ) # type: Literal["2020-10-01-preview"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_configuration.py index 416da770ae97..ec00b522689a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-12-01") # type: str + api_version = kwargs.pop("api_version", "2020-12-01") # type: Literal["2020-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_metadata.json index 7b2544844abf..47826164ee42 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_metadata.json @@ -125,4 +125,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/_configuration.py index 27fe2bbad656..20cb13517e09 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-12-01") # type: str + api_version = kwargs.pop("api_version", "2020-12-01") # type: Literal["2020-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_availability_sets_operations.py index 5c02c66aeef7..af55d212a318 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_host_groups_operations.py index 4e40b1096f0a..42bb14809ad2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -400,7 +405,11 @@ async def delete( # pylint: disable=inconsistent-return-statements @distributed_trace_async async def get( - self, resource_group_name: str, host_group_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + host_group_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> _models.DedicatedHostGroup: """Retrieves information about a dedicated host group. @@ -428,7 +437,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -481,7 +490,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -563,7 +572,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_hosts_operations.py index 5ff23b8e0215..acac45d88249 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -638,7 +643,7 @@ async def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -668,7 +673,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -724,7 +729,7 @@ def list_by_host_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_accesses_operations.py index ccae6b4ee0f6..b9a447df8807 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_encryption_sets_operations.py index c06077ac8673..0c6635fcc5cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_restore_point_operations.py index 84370b0e8f0f..810d68ae0605 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_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]] @@ -101,7 +106,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -162,7 +167,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -252,7 +257,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -446,7 +451,7 @@ async def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -512,7 +517,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -584,7 +589,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disks_operations.py index 69c7360a6e65..5658a0554ce4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_images_operations.py index 49c59b5f03bd..f90d615b848d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_log_analytics_operations.py index 0bc7791c44b1..bb882c91b6ab 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_operations.py index 6fac217698ba..c4130626d5b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_proximity_placement_groups_operations.py index 4984758dc891..40f0a2af5528 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_snapshots_operations.py index 75413ea84936..14985f59b4b7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_ssh_public_keys_operations.py index e9de894eb325..ba25719f315b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_usage_operations.py index 9bfb4b6a4a72..7434c56f49aa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extension_images_operations.py index 17745fbbf887..4381e4588a61 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extensions_operations.py index 63b18f9a8366..efbd426c5d8b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index 92b9926386cf..964c043a9000 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_operations.py index 0a82dbd139d1..a20acf0f4177 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_run_commands_operations.py index d5ce61ce4b43..29c3ef1591bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index ff72fd78d907..9b8f695beeea 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index cf8d7f808824..c7ebe6bb688d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 3720d96197fb..f547b7e2cc6c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 48f58a443f59..8d511ecc7102 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index c9f67ec61ef3..a303d0607003 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -889,7 +894,7 @@ async def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -919,7 +924,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -983,7 +988,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1054,7 +1059,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1145,7 +1150,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1215,7 +1220,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1269,7 +1274,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1327,7 +1332,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1380,7 +1385,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1438,7 +1443,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1491,7 +1496,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1550,7 +1555,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1627,7 +1632,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1677,7 +1682,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1735,7 +1740,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1802,7 +1807,7 @@ async def simulate_eviction( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1852,7 +1857,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2019,7 +2024,7 @@ async def begin_run_command( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_sets_operations.py index 421d8bf2d699..530d60539758 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -671,7 +676,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -736,7 +741,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -788,7 +793,7 @@ async def _deallocate_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -946,7 +951,7 @@ async def begin_deallocate( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -1006,7 +1011,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1168,7 +1173,7 @@ async def begin_delete_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -1236,7 +1241,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1286,7 +1291,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1370,7 +1375,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1458,7 +1463,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1547,7 +1552,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1635,7 +1640,7 @@ async def _power_off_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1809,7 +1814,7 @@ async def begin_power_off( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -1869,7 +1874,7 @@ async def _restart_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2021,7 +2026,7 @@ async def begin_restart( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -2080,7 +2085,7 @@ async def _start_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2232,7 +2237,7 @@ async def begin_start( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -2291,7 +2296,7 @@ async def _redeploy_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2446,7 +2451,7 @@ async def begin_redeploy( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -2505,7 +2510,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2666,7 +2671,7 @@ async def begin_perform_maintenance( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -2725,7 +2730,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2874,7 +2879,7 @@ async def begin_update_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -2933,7 +2938,7 @@ async def _reimage_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3089,7 +3094,7 @@ async def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -3148,7 +3153,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3303,7 +3308,7 @@ async def begin_reimage_all( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -3374,7 +3379,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3504,7 +3509,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3564,7 +3569,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3712,7 +3717,7 @@ async def begin_set_orchestration_service_state( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_sizes_operations.py index a4e960fc3502..d5549f81a0cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machines_operations.py index 99b9cb033df5..85ca56fed285 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -925,7 +930,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace_async async def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -952,7 +957,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1013,7 +1018,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1061,7 +1066,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1117,7 +1122,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1169,7 +1174,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1223,7 +1228,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1292,7 +1297,7 @@ async def generalize( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1338,7 +1343,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1423,7 +1428,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1511,7 +1516,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1594,7 +1599,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1655,7 +1660,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1708,7 +1713,7 @@ async def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1761,7 +1766,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1813,7 +1818,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1866,7 +1871,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1918,7 +1923,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1971,7 +1976,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2023,7 +2028,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2076,7 +2081,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2132,7 +2137,7 @@ async def _reimage_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2282,7 +2287,7 @@ async def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -2357,7 +2362,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2406,7 +2411,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2461,7 +2466,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2525,7 +2530,7 @@ async def simulate_eviction( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2569,7 +2574,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2632,7 +2637,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2692,7 +2697,7 @@ async def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2853,7 +2858,7 @@ async def begin_install_patches( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2912,7 +2917,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3065,7 +3070,7 @@ async def begin_run_command( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/models/_models_py3.py index f10ac06bd4a8..3f0ee834b7fd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -101,8 +106,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_availability_sets_operations.py index f8c13538f880..054b94528283 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_host_groups_operations.py index 8e030785eaeb..466c5ed084cc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -130,12 +135,17 @@ def build_delete_request( def build_get_request( - resource_group_name: str, host_group_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + host_group_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +176,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +204,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -329,7 +339,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -469,7 +479,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -541,7 +551,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -573,7 +583,11 @@ def delete( # pylint: disable=inconsistent-return-statements @distributed_trace def get( - self, resource_group_name: str, host_group_name: str, expand: str = "instanceView", **kwargs: Any + self, + resource_group_name: str, + host_group_name: str, + expand: Literal["instanceView"] = "instanceView", + **kwargs: Any ) -> _models.DedicatedHostGroup: """Retrieves information about a dedicated host group. @@ -601,7 +615,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -651,7 +665,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -732,7 +746,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_hosts_operations.py index 9edf1dd3b2fd..a4a1656ff0ea 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,13 +145,13 @@ def build_get_request( host_name: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -795,7 +800,7 @@ def get( resource_group_name: str, host_group_name: str, host_name: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.DedicatedHost: """Retrieves information about a dedicated host. @@ -825,7 +830,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -880,7 +885,7 @@ def list_by_host_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_accesses_operations.py index 2bee8ec46c86..8482350fe62e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_encryption_sets_operations.py index 7fbab7d7d5b2..e19392699a0c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_restore_point_operations.py index 201b4bc3c653..d2ade7e5ba97 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -259,7 +264,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -319,7 +324,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -409,7 +414,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -600,7 +605,7 @@ def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -666,7 +671,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -738,7 +743,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py index 9f36feca85f4..ee1c64026329 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_images_operations.py index fd33f981840c..7aedcfbd746c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_log_analytics_operations.py index 06a919a850d1..01f701f75f13 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_operations.py index c983c6db1de0..97f940c988a6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_proximity_placement_groups_operations.py index ce89bf70eae2..5ad6f0c85def 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_snapshots_operations.py index e68bd0d9f2a7..cb9218a92600 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_ssh_public_keys_operations.py index 023ecda33b7e..55ff767bd9a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_usage_operations.py index 55e6c1a1e146..08c6afedb6c8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extension_images_operations.py index bbf2bb2ce58e..8e757f928834 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extensions_operations.py index adeab331d1c8..eec8aac7fb9e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_edge_zone_operations.py index 59da655a9adc..3028fe5ba767 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_operations.py index 1be0e3d4f5b3..a2b4cfaaf84f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_run_commands_operations.py index d26a426c3506..3a7967e12fa2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_extensions_operations.py index 45e7e121485d..4bc3454058ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index f9102ed8f77b..2195b837cde1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 760ed65bac8d..bf5929713ba1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 81b966c0fe04..7500689e7687 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vms_operations.py index fe5192e9a6bb..b890afb8bf39 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -168,7 +173,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -197,13 +202,13 @@ def build_get_request( instance_id: str, subscription_id: str, *, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_get_instance_view_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -276,7 +281,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -348,7 +353,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -374,7 +379,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -400,7 +405,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -433,7 +438,7 @@ def build_retrieve_boot_diagnostics_data_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -468,7 +473,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -494,7 +499,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -521,7 +526,7 @@ def build_run_command_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -588,7 +593,7 @@ def _reimage_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -750,7 +755,7 @@ def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -806,7 +811,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -865,7 +870,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -918,7 +923,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -978,7 +983,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1210,7 +1215,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1273,7 +1278,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1340,7 +1345,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1386,7 +1391,7 @@ def get( resource_group_name: str, vm_scale_set_name: str, instance_id: str, - expand: str = "instanceView", + expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachineScaleSetVM: """Gets a virtual machine from a VM scale set. @@ -1416,7 +1421,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1480,7 +1485,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1551,7 +1556,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1642,7 +1647,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1712,7 +1717,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1766,7 +1771,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1824,7 +1829,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1877,7 +1882,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1935,7 +1940,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1988,7 +1993,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2047,7 +2052,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2124,7 +2129,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2174,7 +2179,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2232,7 +2237,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2299,7 +2304,7 @@ def simulate_eviction( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2349,7 +2354,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2513,7 +2518,7 @@ def begin_run_command( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_sets_operations.py index 3e5a117b0cf5..ea75f16eed7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -144,7 +149,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -172,7 +177,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +208,7 @@ def build_deallocate_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -239,7 +244,7 @@ def build_delete_instances_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -272,7 +277,7 @@ def build_get_instance_view_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -301,7 +306,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -329,7 +334,7 @@ def build_list_all_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -357,7 +362,7 @@ def build_list_skus_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -388,7 +393,7 @@ def build_get_os_upgrade_history_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -424,7 +429,7 @@ def build_power_off_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -457,7 +462,7 @@ def build_restart_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -488,7 +493,7 @@ def build_start_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -519,7 +524,7 @@ def build_redeploy_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -550,7 +555,7 @@ def build_perform_maintenance_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -581,7 +586,7 @@ def build_update_instances_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -612,7 +617,7 @@ def build_reimage_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -643,7 +648,7 @@ def build_reimage_all_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -679,7 +684,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -711,7 +716,7 @@ def build_convert_to_single_placement_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -742,7 +747,7 @@ def build_set_orchestration_service_state_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -803,7 +808,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -889,7 +894,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1047,7 +1052,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1108,7 +1113,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1262,7 +1267,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1319,7 +1324,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1378,7 +1383,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1441,7 +1446,7 @@ def get(self, resource_group_name: str, vm_scale_set_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1493,7 +1498,7 @@ def _deallocate_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1651,7 +1656,7 @@ def begin_deallocate( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -1711,7 +1716,7 @@ def _delete_instances_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1873,7 +1878,7 @@ def begin_delete_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -1941,7 +1946,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1991,7 +1996,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2075,7 +2080,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2163,7 +2168,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2252,7 +2257,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2340,7 +2345,7 @@ def _power_off_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2514,7 +2519,7 @@ def begin_power_off( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -2574,7 +2579,7 @@ def _restart_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2726,7 +2731,7 @@ def begin_restart( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -2785,7 +2790,7 @@ def _start_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2937,7 +2942,7 @@ def begin_start( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -2996,7 +3001,7 @@ def _redeploy_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3151,7 +3156,7 @@ def begin_redeploy( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -3210,7 +3215,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3371,7 +3376,7 @@ def begin_perform_maintenance( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -3430,7 +3435,7 @@ def _update_instances_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3579,7 +3584,7 @@ def begin_update_instances( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -3638,7 +3643,7 @@ def _reimage_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3794,7 +3799,7 @@ def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -3853,7 +3858,7 @@ def _reimage_all_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4008,7 +4013,7 @@ def begin_reimage_all( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -4079,7 +4084,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4209,7 +4214,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4269,7 +4274,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4417,7 +4422,7 @@ def begin_set_orchestration_service_state( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_sizes_operations.py index a65688a7bfd0..5d0745fe1147 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machines_operations.py index c0ffe6faaae7..6ebabd3dc0af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -197,12 +202,17 @@ def build_delete_request( def build_get_request( - resource_group_name: str, vm_name: str, subscription_id: str, *, expand: str = "instanceView", **kwargs: Any + resource_group_name: str, + vm_name: str, + subscription_id: str, + *, + expand: Literal["instanceView"] = "instanceView", + **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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -235,7 +245,7 @@ def build_instance_view_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +275,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -290,7 +300,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -315,7 +325,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -339,7 +349,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -367,7 +377,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +405,7 @@ def build_list_available_sizes_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -425,7 +435,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -451,7 +461,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -479,7 +489,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -502,7 +512,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -525,7 +535,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -549,7 +559,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -585,7 +595,7 @@ def build_retrieve_boot_diagnostics_data_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -619,7 +629,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -644,7 +654,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -670,7 +680,7 @@ def build_assess_patches_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -701,7 +711,7 @@ def build_install_patches_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -735,7 +745,7 @@ def build_run_command_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -797,7 +807,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -883,7 +893,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1043,7 +1053,7 @@ def begin_capture( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1102,7 +1112,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1257,7 +1267,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1314,7 +1324,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1462,7 +1472,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1519,7 +1529,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1578,7 +1588,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1619,7 +1629,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def get( - self, resource_group_name: str, vm_name: str, expand: str = "instanceView", **kwargs: Any + self, resource_group_name: str, vm_name: str, expand: Literal["instanceView"] = "instanceView", **kwargs: Any ) -> _models.VirtualMachine: """Retrieves information about the model view or the instance view of a virtual machine. @@ -1646,7 +1656,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1707,7 +1717,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1755,7 +1765,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1809,7 +1819,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1861,7 +1871,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1915,7 +1925,7 @@ def begin_deallocate(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1984,7 +1994,7 @@ def generalize( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2029,7 +2039,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2113,7 +2123,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2200,7 +2210,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2283,7 +2293,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2344,7 +2354,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2397,7 +2407,7 @@ def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2450,7 +2460,7 @@ def begin_reapply(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2502,7 +2512,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2555,7 +2565,7 @@ def begin_restart(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2607,7 +2617,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2660,7 +2670,7 @@ def begin_start(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2712,7 +2722,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2765,7 +2775,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2821,7 +2831,7 @@ def _reimage_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", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2971,7 +2981,7 @@ def begin_reimage( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-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] @@ -3046,7 +3056,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3095,7 +3105,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3148,7 +3158,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3212,7 +3222,7 @@ def simulate_eviction( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3256,7 +3266,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3319,7 +3329,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3379,7 +3389,7 @@ def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3540,7 +3550,7 @@ def begin_install_patches( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3599,7 +3609,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3749,7 +3759,7 @@ def begin_run_command( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: Literal["2020-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_configuration.py index 7224446e04a7..41190fdb653c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-03-01") # type: str + api_version = kwargs.pop("api_version", "2021-03-01") # type: Literal["2021-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_metadata.json index 02c99d62b0f8..78bc32e05d29 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_metadata.json @@ -127,4 +127,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py index 801b6af1f885..509f3fa56234 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-03-01") # type: str + api_version = kwargs.pop("api_version", "2021-03-01") # type: Literal["2021-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_availability_sets_operations.py index cfcc12e60616..405f70f4009e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_operating_systems_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_operating_systems_operations.py index 6222d0e820fc..1cfe18718b1d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_operating_systems_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_operating_systems_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -35,6 +36,10 @@ build_list_os_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ async def get_os_version(self, location: str, os_version_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersion] request = build_get_os_version_request( @@ -134,7 +139,7 @@ def list_os_versions(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersionListResult] error_map = { @@ -227,7 +232,7 @@ async def get_os_family(self, location: str, os_family_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamily] request = build_get_os_family_request( @@ -278,7 +283,7 @@ def list_os_families(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamilyListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_role_instances_operations.py index ad262c64529e..dea565ecc032 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -41,6 +42,10 @@ build_restart_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -136,7 +141,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -211,7 +216,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -275,7 +280,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -338,7 +343,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -422,7 +427,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -481,7 +486,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -534,7 +539,7 @@ async def _reimage_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -593,7 +598,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -646,7 +651,7 @@ async def _rebuild_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -706,7 +711,7 @@ async def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -773,7 +778,7 @@ async def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[AsyncIterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_roles_operations.py index 9b6d3bfb00a8..908d505f36d9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._cloud_service_roles_operations import build_get_request, 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]] @@ -81,7 +86,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -136,7 +141,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_operations.py index 53cda9307413..a253ace354a2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,6 +47,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -249,7 +254,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -310,7 +315,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -465,7 +470,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -577,7 +582,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -639,7 +644,7 @@ async def get(self, resource_group_name: str, cloud_service_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -699,7 +704,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -748,7 +753,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -832,7 +837,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -914,7 +919,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -969,7 +974,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1021,7 +1026,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1077,7 +1082,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1133,7 +1138,7 @@ async def _restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1281,7 +1286,7 @@ async def begin_restart( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -1340,7 +1345,7 @@ async def _reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1491,7 +1496,7 @@ async def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -1550,7 +1555,7 @@ async def _rebuild_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1704,7 +1709,7 @@ async def begin_rebuild( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -1763,7 +1768,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1911,7 +1916,7 @@ async def begin_delete_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_update_domain_operations.py index 00aea69369bc..c03f077c0064 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -36,6 +37,10 @@ build_walk_update_domain_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _walk_update_domain_initial( # pylint: disable=inconsistent-return-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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -242,7 +247,7 @@ async def begin_walk_update_domain( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -316,7 +321,7 @@ async def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -370,7 +375,7 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_host_groups_operations.py index e55c7de0e408..91190b4c1b45 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -433,7 +438,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_hosts_operations.py index dccb98b1fcd4..2c2b0beac9a7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -725,7 +730,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_images_operations.py index bbd77f26d022..6e1266c7c816 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_log_analytics_operations.py index 74dc048c2d69..95c59ae2e4f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_operations.py index d71e2eeb9757..f5b9cc6454b6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_proximity_placement_groups_operations.py index 5190855aa4e1..c25aa51123e5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_point_collections_operations.py index 40dc894bb2ec..1517993ee8cb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -303,7 +308,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -364,7 +369,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -421,7 +426,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -493,7 +498,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -545,7 +550,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -630,7 +635,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_points_operations.py index f3a860def1f6..048eabca7882 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_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]] @@ -71,7 +76,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -237,7 +242,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -295,7 +300,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -354,7 +359,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_ssh_public_keys_operations.py index c54b8db485a7..8a0befecc782 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_usage_operations.py index 2da4018a80a1..157aff99fdc7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extension_images_operations.py index 31b70b8323b3..b322c200238d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extensions_operations.py index 7508e01c86a5..62b3ae207118 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index eb3ff6e4aff7..6e5b6dcbbd75 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -179,7 +184,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -249,7 +254,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -311,7 +316,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -377,7 +382,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_operations.py index 8cf46bdfef7c..6202fc83a9e5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_run_commands_operations.py index 4fbe2b312f4b..233ccd44adf4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -399,7 +404,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -462,7 +467,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -633,7 +638,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -691,7 +696,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -751,7 +756,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -820,7 +825,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -879,7 +884,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index aeafa65cc128..ed0fbfb40a28 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index cd12c7c23007..4cde1d3c3f3b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 9f67a58c6746..f108da1d74f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -262,7 +267,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -507,7 +512,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -566,7 +571,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -628,7 +633,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -706,7 +711,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -779,7 +784,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 15d176147d6c..ba9688ae6df0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -263,7 +268,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -328,7 +333,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -506,7 +511,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -565,7 +570,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -627,7 +632,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -705,7 +710,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -772,7 +777,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 1f37f7484580..ba535851ed0c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1679,7 +1684,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1737,7 +1742,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1804,7 +1809,7 @@ async def simulate_eviction( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1854,7 +1859,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2021,7 +2026,7 @@ async def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_sets_operations.py index da53a51c6325..4c9dbc0bd0ca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -183,7 +188,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -341,7 +346,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -556,7 +561,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -613,7 +618,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -672,7 +677,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -798,7 +803,7 @@ async def _deallocate_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -956,7 +961,7 @@ async def begin_deallocate( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -1016,7 +1021,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1178,7 +1183,7 @@ async def begin_delete_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -1246,7 +1251,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1296,7 +1301,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1380,7 +1385,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1468,7 +1473,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1557,7 +1562,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1645,7 +1650,7 @@ async def _power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1819,7 +1824,7 @@ async def begin_power_off( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -1879,7 +1884,7 @@ async def _restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2031,7 +2036,7 @@ async def begin_restart( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -2090,7 +2095,7 @@ async def _start_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2242,7 +2247,7 @@ async def begin_start( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -2301,7 +2306,7 @@ async def _redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2456,7 +2461,7 @@ async def begin_redeploy( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -2515,7 +2520,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2676,7 +2681,7 @@ async def begin_perform_maintenance( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -2735,7 +2740,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2884,7 +2889,7 @@ async def begin_update_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -2943,7 +2948,7 @@ async def _reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3099,7 +3104,7 @@ async def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -3158,7 +3163,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3313,7 +3318,7 @@ async def begin_reimage_all( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -3384,7 +3389,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3514,7 +3519,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3574,7 +3579,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3722,7 +3727,7 @@ async def begin_set_orchestration_service_state( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_sizes_operations.py index 2c39502384d6..1a28435390f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machines_operations.py index f3543c13e508..3c0c26ac462b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1230,7 +1235,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1299,7 +1304,7 @@ async def generalize( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1345,7 +1350,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1430,7 +1435,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1518,7 +1523,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1601,7 +1606,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1662,7 +1667,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1715,7 +1720,7 @@ async def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1769,7 +1774,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1821,7 +1826,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1874,7 +1879,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1926,7 +1931,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1979,7 +1984,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2031,7 +2036,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2084,7 +2089,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2140,7 +2145,7 @@ async def _reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2290,7 +2295,7 @@ async def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -2365,7 +2370,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2415,7 +2420,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2470,7 +2475,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2534,7 +2539,7 @@ async def simulate_eviction( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2578,7 +2583,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2642,7 +2647,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2702,7 +2707,7 @@ async def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2864,7 +2869,7 @@ async def begin_install_patches( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2923,7 +2928,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3076,7 +3081,7 @@ async def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py index 97d9a136fc7c..fc0f51294bb0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -78,8 +83,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_availability_sets_operations.py index 91dc9bb6e0f1..0253924526cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_operating_systems_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_operating_systems_operations.py index 7a1682925e2f..082c2e170d59 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_operating_systems_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_operating_systems_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_get_os_version_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_os_versions_request(location: 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +104,7 @@ def build_get_os_family_request(location: str, os_family_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +133,7 @@ def build_list_os_families_request(location: 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -196,7 +201,7 @@ def get_os_version(self, location: str, os_version_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersion] request = build_get_os_version_request( @@ -246,7 +251,7 @@ def list_os_versions(self, location: str, **kwargs: Any) -> Iterable["_models.OS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersionListResult] error_map = { @@ -339,7 +344,7 @@ def get_os_family(self, location: str, os_family_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamily] request = build_get_os_family_request( @@ -389,7 +394,7 @@ def list_os_families(self, location: str, **kwargs: Any) -> Iterable["_models.OS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamilyListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_role_instances_operations.py index 3f4423f58f89..fbba0a7a859c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +87,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +121,7 @@ def build_get_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +158,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +255,7 @@ def build_rebuild_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +287,7 @@ def build_get_remote_desktop_file_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/x-rdp") # Construct URL @@ -341,7 +346,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -399,7 +404,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -474,7 +479,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -538,7 +543,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -600,7 +605,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -684,7 +689,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -743,7 +748,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -796,7 +801,7 @@ def _reimage_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -855,7 +860,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -908,7 +913,7 @@ def _rebuild_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -968,7 +973,7 @@ def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[Iterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_roles_operations.py index 857b132f92fd..2b9e721745d1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +79,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -200,7 +205,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_operations.py index da23cb038a2e..dad15f52ba55 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def build_get_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +208,7 @@ def build_list_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -227,7 +232,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +262,7 @@ def build_start_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def build_power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +324,7 @@ def build_restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -353,7 +358,7 @@ def build_reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -387,7 +392,7 @@ def build_rebuild_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -421,7 +426,7 @@ def build_delete_instances_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -486,7 +491,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -648,7 +653,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -709,7 +714,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -864,7 +869,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -921,7 +926,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -974,7 +979,7 @@ def begin_delete(self, resource_group_name: str, cloud_service_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ def get(self, resource_group_name: str, cloud_service_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -1096,7 +1101,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -1144,7 +1149,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1227,7 +1232,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Clo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1309,7 +1314,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1362,7 +1367,7 @@ def begin_start(self, resource_group_name: str, cloud_service_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1414,7 +1419,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1468,7 +1473,7 @@ def begin_power_off(self, resource_group_name: str, cloud_service_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1524,7 +1529,7 @@ def _restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1672,7 +1677,7 @@ def begin_restart( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -1731,7 +1736,7 @@ def _reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1882,7 +1887,7 @@ def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -1941,7 +1946,7 @@ def _rebuild_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2095,7 +2100,7 @@ def begin_rebuild( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -2154,7 +2159,7 @@ def _delete_instances_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2302,7 +2307,7 @@ def begin_delete_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_update_domain_operations.py index c6b4a228d297..70f5d780868c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_walk_update_domain_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_get_update_domain_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_list_update_domains_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def _walk_update_domain_initial( # pylint: disable=inconsistent-return-statemen _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -338,7 +343,7 @@ def begin_walk_update_domain( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -412,7 +417,7 @@ def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -465,7 +470,7 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_host_groups_operations.py index 627c13e84d0c..b81895179166 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,7 +145,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +176,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +204,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -334,7 +339,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -474,7 +479,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -546,7 +551,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -661,7 +666,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -742,7 +747,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_hosts_operations.py index 3601a3082164..b40aba824596 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -881,7 +886,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_images_operations.py index aa5bc1fd2fd0..c99125a733a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_log_analytics_operations.py index 150fd072a58f..92b626dd559a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_operations.py index 9b918dab6fa7..c0bef4ceb7ef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_proximity_placement_groups_operations.py index 8f282710cde0..b81b1a4e99cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_point_collections_operations.py index 7027ef8ed29a..4166d7238a30 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -497,7 +502,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -558,7 +563,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -615,7 +620,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -687,7 +692,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -739,7 +744,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -824,7 +829,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_points_operations.py index b18b8885ad0d..dc126dea5f45 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +130,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -357,7 +362,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -415,7 +420,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -474,7 +479,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -541,7 +546,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_ssh_public_keys_operations.py index 5fec38cf5c87..1f20a9ed8148 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_usage_operations.py index 512856e633b0..800dc542e35d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extension_images_operations.py index a50949cb5983..3cd60741e0a3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extensions_operations.py index ea35716a0b65..d36f9130e655 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_edge_zone_operations.py index c1e8f4bcdde1..f1e6aff22ef7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -362,7 +367,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -432,7 +437,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -494,7 +499,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -560,7 +565,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_operations.py index d232fe7ae556..1edb3c4757e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_run_commands_operations.py index 2f7d0df6069a..080e34316ead 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -624,7 +629,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -687,7 +692,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -858,7 +863,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -916,7 +921,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -976,7 +981,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1045,7 +1050,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1104,7 +1109,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py index dd80820e99ca..84a5057ef79b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 3921142330e4..2a6020f7396f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 90c41a52d410..66cf66362f2a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -461,7 +466,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -526,7 +531,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -706,7 +711,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -765,7 +770,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -827,7 +832,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -978,7 +983,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index ab68116a5a7b..e0c0ea17f9f3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -461,7 +466,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -526,7 +531,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -704,7 +709,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -825,7 +830,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -903,7 +908,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -970,7 +975,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vms_operations.py index c415da08175a..6b6f5454df38 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -168,7 +173,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -203,7 +208,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_get_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -276,7 +281,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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -348,7 +353,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -374,7 +379,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -400,7 +405,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -433,7 +438,7 @@ def build_retrieve_boot_diagnostics_data_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -468,7 +473,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -494,7 +499,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -521,7 +526,7 @@ def build_run_command_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -588,7 +593,7 @@ def _reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -750,7 +755,7 @@ def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -806,7 +811,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -865,7 +870,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -918,7 +923,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -978,7 +983,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1210,7 +1215,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1273,7 +1278,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1340,7 +1345,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1417,7 +1422,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1481,7 +1486,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1552,7 +1557,7 @@ 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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1643,7 +1648,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1713,7 +1718,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1767,7 +1772,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1825,7 +1830,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1878,7 +1883,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1936,7 +1941,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1989,7 +1994,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2048,7 +2053,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2125,7 +2130,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2176,7 +2181,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2234,7 +2239,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2301,7 +2306,7 @@ def simulate_eviction( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2351,7 +2356,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2515,7 +2520,7 @@ def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_sets_operations.py index cd5f58bd7927..55b04bc95070 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -144,7 +149,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -177,7 +182,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_deallocate_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -246,7 +251,7 @@ def build_delete_instances_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -279,7 +284,7 @@ def build_get_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,7 +341,7 @@ def build_list_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -364,7 +369,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +400,7 @@ def build_get_os_upgrade_history_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -431,7 +436,7 @@ def build_power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -464,7 +469,7 @@ def build_restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -495,7 +500,7 @@ def build_start_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -526,7 +531,7 @@ def build_redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -557,7 +562,7 @@ def build_perform_maintenance_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -588,7 +593,7 @@ def build_update_instances_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -619,7 +624,7 @@ def build_reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -650,7 +655,7 @@ def build_reimage_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -686,7 +691,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -718,7 +723,7 @@ def build_convert_to_single_placement_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -749,7 +754,7 @@ def build_set_orchestration_service_state_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -810,7 +815,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -897,7 +902,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1055,7 +1060,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1116,7 +1121,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1270,7 +1275,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1327,7 +1332,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1386,7 +1391,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1459,7 +1464,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1512,7 +1517,7 @@ def _deallocate_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1670,7 +1675,7 @@ def begin_deallocate( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -1730,7 +1735,7 @@ def _delete_instances_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1892,7 +1897,7 @@ def begin_delete_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -1960,7 +1965,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2010,7 +2015,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2094,7 +2099,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2182,7 +2187,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2271,7 +2276,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2359,7 +2364,7 @@ def _power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2533,7 +2538,7 @@ def begin_power_off( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -2593,7 +2598,7 @@ def _restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2745,7 +2750,7 @@ def begin_restart( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -2804,7 +2809,7 @@ def _start_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2956,7 +2961,7 @@ def begin_start( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -3015,7 +3020,7 @@ def _redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3170,7 +3175,7 @@ def begin_redeploy( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -3229,7 +3234,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3390,7 +3395,7 @@ def begin_perform_maintenance( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -3449,7 +3454,7 @@ def _update_instances_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3598,7 +3603,7 @@ def begin_update_instances( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -3657,7 +3662,7 @@ def _reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3813,7 +3818,7 @@ def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -3872,7 +3877,7 @@ def _reimage_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4027,7 +4032,7 @@ def begin_reimage_all( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -4098,7 +4103,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4228,7 +4233,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4288,7 +4293,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4436,7 +4441,7 @@ def begin_set_orchestration_service_state( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_sizes_operations.py index 02d9a587384d..1a8c5509921f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machines_operations.py index 505594b515d8..aaaac4da8059 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -207,7 +212,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +245,7 @@ def build_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,7 +275,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -295,7 +300,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -320,7 +325,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -344,7 +349,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +377,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -400,7 +405,7 @@ def build_list_available_sizes_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -430,7 +435,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -456,7 +461,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -484,7 +489,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -507,7 +512,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -530,7 +535,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -554,7 +559,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -590,7 +595,7 @@ def build_retrieve_boot_diagnostics_data_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -624,7 +629,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -649,7 +654,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -675,7 +680,7 @@ def build_assess_patches_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -706,7 +711,7 @@ def build_install_patches_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -740,7 +745,7 @@ def build_run_command_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -802,7 +807,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -888,7 +893,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1048,7 +1053,7 @@ def begin_capture( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1107,7 +1112,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1262,7 +1267,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1319,7 +1324,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1467,7 +1472,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1524,7 +1529,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1583,7 +1588,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1658,7 +1663,7 @@ 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1719,7 +1724,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1767,7 +1772,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1821,7 +1826,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1873,7 +1878,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1927,7 +1932,7 @@ def begin_deallocate(self, resource_group_name: str, vm_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1996,7 +2001,7 @@ def generalize( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2041,7 +2046,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2125,7 +2130,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2212,7 +2217,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2295,7 +2300,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2356,7 +2361,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2409,7 +2414,7 @@ def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2463,7 +2468,7 @@ def begin_reapply(self, resource_group_name: str, vm_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2515,7 +2520,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2568,7 +2573,7 @@ def begin_restart(self, resource_group_name: str, vm_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2620,7 +2625,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2673,7 +2678,7 @@ def begin_start(self, resource_group_name: str, vm_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2725,7 +2730,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2778,7 +2783,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2834,7 +2839,7 @@ def _reimage_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2984,7 +2989,7 @@ def begin_reimage( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-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] @@ -3059,7 +3064,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3109,7 +3114,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3162,7 +3167,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3226,7 +3231,7 @@ def simulate_eviction( # 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3270,7 +3275,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3334,7 +3339,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3394,7 +3399,7 @@ def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3556,7 +3561,7 @@ def begin_install_patches( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3615,7 +3620,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3765,7 +3770,7 @@ def begin_run_command( _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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: Literal["2021-03-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_configuration.py index b99e24f4e365..9cf839a332c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-04-01") # type: str + api_version = kwargs.pop("api_version", "2021-04-01") # type: Literal["2021-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_metadata.json index dc7373170263..d8e056bb7218 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_metadata.json @@ -129,4 +129,4 @@ "disk_accesses": "DiskAccessesOperations", "disk_restore_point": "DiskRestorePointOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/_configuration.py index ca3d52402e13..0b74d343c264 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-04-01") # type: str + api_version = kwargs.pop("api_version", "2021-04-01") # type: Literal["2021-04-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_availability_sets_operations.py index aca3e6961de7..880647c85d75 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservation_groups_operations.py index bf92ca8843e6..5257e7af9955 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -301,7 +306,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -376,7 +381,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -443,7 +448,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -506,7 +511,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -598,7 +603,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservations_operations.py index b0b5324f92ea..d98407c10b86 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -318,7 +323,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -485,7 +490,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -744,7 +749,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_host_groups_operations.py index 29ca01d344c4..4bc5e026bf84 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -433,7 +438,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_hosts_operations.py index a4ac4e9bedf4..a461f0b36478 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -249,7 +254,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -477,7 +482,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -593,7 +598,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -725,7 +730,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_accesses_operations.py index d79be134a75d..2f43404420b2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_encryption_sets_operations.py index 43cc329fdadf..913a6edcd14b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_restore_point_operations.py index ab1b6a394145..ac6953a054eb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -156,7 +161,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -246,7 +251,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -428,7 +433,7 @@ async def begin_grant_access( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -494,7 +499,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -562,7 +567,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disks_operations.py index 12e8103471f6..2d9c776a6c14 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_images_operations.py index 8c3242b0d7f3..2d477765e02e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_log_analytics_operations.py index 01958ec79b3c..a725963aeeac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_operations.py index 0c6b22ca6538..b23a5e32a875 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_proximity_placement_groups_operations.py index af3d5b08f59e..b20fb4abdf7e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_point_collections_operations.py index f30344d40813..94bff20a19bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -302,7 +307,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -362,7 +367,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -418,7 +423,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -490,7 +495,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -541,7 +546,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -625,7 +630,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_points_operations.py index 0a3469cf8d04..273356869a04 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_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]] @@ -71,7 +76,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -236,7 +241,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +299,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -352,7 +357,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_snapshots_operations.py index ff5704f0f462..fc08d7e78bc2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_ssh_public_keys_operations.py index 5570fc01292e..19e5fb593f80 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_usage_operations.py index a4c5b4e58cde..76db971104c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extension_images_operations.py index cb1d0907d651..9f2ee993aeb7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extensions_operations.py index 3cfe188cf82b..05db035368fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index fc9f286291dc..6a7e936a0cd6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_operations.py index c9600c350160..795016d95120 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_run_commands_operations.py index 49026c26f133..f65b43b3e7d7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 6931fc13cf88..f91532c8f52f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index fa32e4997c98..19176e666d5a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 8d2b307233e7..daadfa346b70 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 047d3eb8fb88..96b16d26b9d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 9fe3958f89dc..34097d5f5e8f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1678,7 +1683,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1736,7 +1741,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def simulate_eviction( # 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1853,7 +1858,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2020,7 +2025,7 @@ async def begin_run_command( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_sets_operations.py index b64b13465c89..8173f3aa85af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -671,7 +676,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,7 +749,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -797,7 +802,7 @@ async def _deallocate_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -955,7 +960,7 @@ async def begin_deallocate( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -1015,7 +1020,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1177,7 +1182,7 @@ async def begin_delete_instances( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -1245,7 +1250,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1295,7 +1300,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1379,7 +1384,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1467,7 +1472,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1556,7 +1561,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1644,7 +1649,7 @@ async def _power_off_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1818,7 +1823,7 @@ async def begin_power_off( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -1878,7 +1883,7 @@ async def _restart_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2030,7 +2035,7 @@ async def begin_restart( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -2089,7 +2094,7 @@ async def _start_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2241,7 +2246,7 @@ async def begin_start( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -2300,7 +2305,7 @@ async def _redeploy_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2455,7 +2460,7 @@ async def begin_redeploy( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -2514,7 +2519,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2675,7 +2680,7 @@ async def begin_perform_maintenance( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -2734,7 +2739,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2883,7 +2888,7 @@ async def begin_update_instances( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -2942,7 +2947,7 @@ async def _reimage_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3098,7 +3103,7 @@ async def begin_reimage( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -3157,7 +3162,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3312,7 +3317,7 @@ async def begin_reimage_all( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -3383,7 +3388,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3513,7 +3518,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3573,7 +3578,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3721,7 +3726,7 @@ async def begin_set_orchestration_service_state( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_sizes_operations.py index 386bcba947fd..6114bcbd931a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py index 8995954e8e35..ce6a46c0b01e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1230,7 +1235,7 @@ async def begin_deallocate(self, resource_group_name: str, vm_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1299,7 +1304,7 @@ async def generalize( # 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1345,7 +1350,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1430,7 +1435,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1518,7 +1523,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1601,7 +1606,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1662,7 +1667,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1715,7 +1720,7 @@ async def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1768,7 +1773,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1820,7 +1825,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1873,7 +1878,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1925,7 +1930,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1978,7 +1983,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2030,7 +2035,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2083,7 +2088,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2139,7 +2144,7 @@ async def _reimage_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2289,7 +2294,7 @@ async def begin_reimage( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -2364,7 +2369,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2413,7 +2418,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2468,7 +2473,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2532,7 +2537,7 @@ async def simulate_eviction( # 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2576,7 +2581,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2639,7 +2644,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2699,7 +2704,7 @@ async def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2860,7 +2865,7 @@ async def begin_install_patches( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2919,7 +2924,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3072,7 +3077,7 @@ async def begin_run_command( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py index 45e6dcef548f..847a0900c97b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -101,8 +106,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_availability_sets_operations.py index afd1dee6f9f2..c6f85d80e545 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -492,7 +497,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -564,7 +569,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservation_groups_operations.py index 8f68bae08f1a..456d209da57b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,7 +370,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -510,7 +515,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -585,7 +590,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -715,7 +720,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -807,7 +812,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservations_operations.py index eb582ad4a70c..fac5c2043be9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -89,7 +94,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -130,7 +135,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_capacity_reservation_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -446,7 +451,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -509,7 +514,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -676,7 +681,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -802,7 +807,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -879,7 +884,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -935,7 +940,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_host_groups_operations.py index 72939edd6ec3..115ee2760e23 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,7 +145,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +176,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +204,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -334,7 +339,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -474,7 +479,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -546,7 +551,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -661,7 +666,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -742,7 +747,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_hosts_operations.py index a21fcdba4958..6e4c4c95802a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -409,7 +414,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -634,7 +639,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -881,7 +886,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_accesses_operations.py index e151bc355bf9..be2b884f9c7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_encryption_sets_operations.py index 9d51a0ab67fd..27481f69d04b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_restore_point_operations.py index 2bee01640ff8..26cfd682727d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -313,7 +318,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -403,7 +408,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -582,7 +587,7 @@ def begin_grant_access( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -648,7 +653,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -716,7 +721,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disks_operations.py index 7e95ba3cc9b6..2a3f7f00f507 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_images_operations.py index 633d840f62da..0e2c297653de 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_log_analytics_operations.py index 04ed192d568b..1e34375f03ab 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_operations.py index 17b838a40d91..b0ec31c1705b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_proximity_placement_groups_operations.py index 50c50aeddd88..f7a2a4fb46ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -484,7 +489,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_point_collections_operations.py index e55df533e1bd..665530055911 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -496,7 +501,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -556,7 +561,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,7 +689,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -735,7 +740,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -819,7 +824,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_points_operations.py index a353aac2ad03..16a5a1f61114 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +130,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -356,7 +361,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -414,7 +419,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -472,7 +477,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_snapshots_operations.py index c86b59665256..65e85524320f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_ssh_public_keys_operations.py index b483755638b4..45d3ef7f4e96 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -661,7 +666,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_usage_operations.py index cb5025b2f719..a92bd35d45f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extension_images_operations.py index 8b533fbede35..4eb59e6c777e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extensions_operations.py index 45304548679d..4c4ad9ca9525 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_edge_zone_operations.py index 4fa8384f7f95..7e59bb24631e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_operations.py index 04a763af68e2..e91c79deb9b0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_run_commands_operations.py index 5cd9f8e5d624..b487c993260b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_extensions_operations.py index 2c0207047776..45ef5fb04663 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -775,7 +780,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index eb330852641d..60109a46dfc5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 9c228c050bb9..7fa9c11b79cb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 6018faa8e90b..afdc5e0b3705 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vms_operations.py index de8443c27b12..9b53ec53f008 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -168,7 +173,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -203,7 +208,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_get_instance_view_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -276,7 +281,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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -348,7 +353,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -374,7 +379,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -400,7 +405,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -433,7 +438,7 @@ def build_retrieve_boot_diagnostics_data_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -468,7 +473,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -494,7 +499,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -521,7 +526,7 @@ def build_run_command_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -588,7 +593,7 @@ def _reimage_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -750,7 +755,7 @@ def begin_reimage( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -806,7 +811,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -865,7 +870,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -918,7 +923,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -978,7 +983,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1210,7 +1215,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1273,7 +1278,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1340,7 +1345,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1417,7 +1422,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1481,7 +1486,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1552,7 +1557,7 @@ 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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1643,7 +1648,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1713,7 +1718,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1767,7 +1772,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1825,7 +1830,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1878,7 +1883,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1936,7 +1941,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1989,7 +1994,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2048,7 +2053,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2125,7 +2130,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2175,7 +2180,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2233,7 +2238,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2300,7 +2305,7 @@ def simulate_eviction( # 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2350,7 +2355,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2514,7 +2519,7 @@ def begin_run_command( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_sets_operations.py index d1f8c134b6fe..fb2c3cfc4072 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -144,7 +149,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -177,7 +182,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_deallocate_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -246,7 +251,7 @@ def build_delete_instances_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -279,7 +284,7 @@ def build_get_instance_view_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,7 +341,7 @@ def build_list_all_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -364,7 +369,7 @@ def build_list_skus_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +400,7 @@ def build_get_os_upgrade_history_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -431,7 +436,7 @@ def build_power_off_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -464,7 +469,7 @@ def build_restart_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -495,7 +500,7 @@ def build_start_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -526,7 +531,7 @@ def build_redeploy_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -557,7 +562,7 @@ def build_perform_maintenance_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -588,7 +593,7 @@ def build_update_instances_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -619,7 +624,7 @@ def build_reimage_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -650,7 +655,7 @@ def build_reimage_all_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -686,7 +691,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -718,7 +723,7 @@ def build_convert_to_single_placement_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -749,7 +754,7 @@ def build_set_orchestration_service_state_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -810,7 +815,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -896,7 +901,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1054,7 +1059,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1115,7 +1120,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1269,7 +1274,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1326,7 +1331,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1385,7 +1390,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1458,7 +1463,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1511,7 +1516,7 @@ def _deallocate_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1669,7 +1674,7 @@ def begin_deallocate( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -1729,7 +1734,7 @@ def _delete_instances_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1891,7 +1896,7 @@ def begin_delete_instances( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -1959,7 +1964,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2009,7 +2014,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2093,7 +2098,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2181,7 +2186,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2270,7 +2275,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2358,7 +2363,7 @@ def _power_off_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2532,7 +2537,7 @@ def begin_power_off( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -2592,7 +2597,7 @@ def _restart_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2744,7 +2749,7 @@ def begin_restart( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -2803,7 +2808,7 @@ def _start_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2955,7 +2960,7 @@ def begin_start( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -3014,7 +3019,7 @@ def _redeploy_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3169,7 +3174,7 @@ def begin_redeploy( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -3228,7 +3233,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3389,7 +3394,7 @@ def begin_perform_maintenance( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -3448,7 +3453,7 @@ def _update_instances_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3597,7 +3602,7 @@ def begin_update_instances( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -3656,7 +3661,7 @@ def _reimage_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3812,7 +3817,7 @@ def begin_reimage( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -3871,7 +3876,7 @@ def _reimage_all_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4026,7 +4031,7 @@ def begin_reimage_all( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -4097,7 +4102,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4227,7 +4232,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4287,7 +4292,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4435,7 +4440,7 @@ def begin_set_orchestration_service_state( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py index 08e5b7282b22..7911519bb4f3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machines_operations.py index 73dcd7811892..8c076f8300a6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -207,7 +212,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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +245,7 @@ def build_instance_view_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,7 +275,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -295,7 +300,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -320,7 +325,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -344,7 +349,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +377,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -400,7 +405,7 @@ def build_list_available_sizes_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -430,7 +435,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -456,7 +461,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -484,7 +489,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -507,7 +512,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -530,7 +535,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -554,7 +559,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] # Construct URL _url = kwargs.pop( @@ -590,7 +595,7 @@ def build_retrieve_boot_diagnostics_data_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -624,7 +629,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -649,7 +654,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -675,7 +680,7 @@ def build_assess_patches_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -706,7 +711,7 @@ def build_install_patches_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -740,7 +745,7 @@ def build_run_command_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -802,7 +807,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -888,7 +893,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1048,7 +1053,7 @@ def begin_capture( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1107,7 +1112,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1262,7 +1267,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1319,7 +1324,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1467,7 +1472,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1524,7 +1529,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1583,7 +1588,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1658,7 +1663,7 @@ 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1719,7 +1724,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1767,7 +1772,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1821,7 +1826,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1873,7 +1878,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1927,7 +1932,7 @@ def begin_deallocate(self, resource_group_name: str, vm_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1996,7 +2001,7 @@ def generalize( # 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2041,7 +2046,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2125,7 +2130,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2212,7 +2217,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2295,7 +2300,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2356,7 +2361,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2409,7 +2414,7 @@ def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2462,7 +2467,7 @@ def begin_reapply(self, resource_group_name: str, vm_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2514,7 +2519,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2567,7 +2572,7 @@ def begin_restart(self, resource_group_name: str, vm_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2619,7 +2624,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2672,7 +2677,7 @@ def begin_start(self, resource_group_name: str, vm_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2724,7 +2729,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2777,7 +2782,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2833,7 +2838,7 @@ def _reimage_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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2983,7 +2988,7 @@ def begin_reimage( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-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] @@ -3058,7 +3063,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3107,7 +3112,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3160,7 +3165,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3224,7 +3229,7 @@ def simulate_eviction( # 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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3268,7 +3273,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3331,7 +3336,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3391,7 +3396,7 @@ def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3552,7 +3557,7 @@ def begin_install_patches( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3611,7 +3616,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3761,7 +3766,7 @@ def begin_run_command( _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-04-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) # type: Literal["2021-04-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_configuration.py index 026062671e53..b3e219d6f4c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-07-01") # type: str + api_version = kwargs.pop("api_version", "2021-07-01") # type: Literal["2021-07-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json index 913dbd9606e2..47866080547a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json @@ -137,4 +137,4 @@ "community_gallery_images": "CommunityGalleryImagesOperations", "community_gallery_image_versions": "CommunityGalleryImageVersionsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_configuration.py index 8f9a199ff200..a8a7cbf95cfc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-07-01") # type: str + api_version = kwargs.pop("api_version", "2021-07-01") # type: Literal["2021-07-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_availability_sets_operations.py index f046a518cec1..150ecdd79619 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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-07-01")) # type: str + 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.AvailabilitySet] @@ -287,7 +292,7 @@ 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: str + 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.AvailabilitySet] @@ -359,7 +364,7 @@ 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-07-01")) # type: str + 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[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _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: str + 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.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2021-07-01")) # type: str + 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.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _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: str + 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.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py index d31ca381a259..691997bee73f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-07-01")) # type: str + 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.CapacityReservationGroup] @@ -301,7 +306,7 @@ 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: str + 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.CapacityReservationGroup] @@ -376,7 +381,7 @@ 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-07-01")) # type: str + 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[None] request = build_delete_request( @@ -443,7 +448,7 @@ 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-07-01")) # type: str + 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.CapacityReservationGroup] request = build_get_request( @@ -506,7 +511,7 @@ 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", "2021-07-01")) # type: str + 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.CapacityReservationGroupListResult] error_map = { @@ -598,7 +603,7 @@ 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", "2021-07-01")) # type: str + 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.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py index a73701ee9bc8..702bf27bb069 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.CapacityReservation] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -318,7 +323,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.CapacityReservation]] @@ -485,7 +490,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -611,7 +616,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ 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-07-01")) # type: str + 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.CapacityReservation] request = build_get_request( @@ -744,7 +749,7 @@ def list_by_capacity_reservation_group( _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: str + 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.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py index 4953cb6161cc..b26a1be23998 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._community_galleries_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]] @@ -74,7 +79,7 @@ async def get(self, location: str, public_gallery_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", "2021-07-01")) # type: str + 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.CommunityGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py index 7ddc21cabc7d..aeffad1620f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._community_gallery_image_versions_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]] @@ -88,7 +93,7 @@ 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-07-01")) # type: str + 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.CommunityGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py index 5c03da0eb0e4..fc0be6fc605b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._community_gallery_images_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]] @@ -78,7 +83,7 @@ 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-07-01")) # type: str + 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.CommunityGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py index f718bea6d4b7..8d85b3428517 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-07-01")) # type: str + 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.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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: str + 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.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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-07-01")) # type: str + 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[None] request = build_delete_request( @@ -433,7 +438,7 @@ 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-07-01")) # type: str + 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.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ 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", "2021-07-01")) # type: str + 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.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _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: str + 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.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_hosts_operations.py index 6b3ad0432361..557d5d3377cc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.DedicatedHost] @@ -249,7 +254,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -312,7 +317,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.DedicatedHost] @@ -477,7 +482,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -593,7 +598,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ 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-07-01")) # type: str + 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.DedicatedHost] request = build_get_request( @@ -725,7 +730,7 @@ def list_by_host_group( _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: str + 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.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_galleries_operations.py index b30605a3b627..a984c0c2ccdc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Gallery] @@ -239,7 +244,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Gallery] @@ -450,7 +455,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -526,7 +531,7 @@ 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-07-01")) # type: str + 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.Gallery] request = build_get_request( @@ -575,7 +580,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -628,7 +633,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -680,7 +685,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryList] error_map = { @@ -760,7 +765,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _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: str + 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.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py index 7c4dd9802688..1db23a742689 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplicationVersion] @@ -282,7 +287,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplicationVersion] @@ -541,7 +546,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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-07-01")) # type: str + 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.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -753,7 +758,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _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: str + 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.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py index 8fd7e8cf0751..b415ad23a2ed 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplication] @@ -263,7 +268,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplication] @@ -503,7 +508,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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-07-01")) # type: str + 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.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -686,7 +691,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _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: str + 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.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py index fb955e17c53b..dc6bba90d623 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImageVersion] @@ -280,7 +285,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImageVersion] @@ -538,7 +543,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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-07-01")) # type: str + 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.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -750,7 +755,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _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: str + 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.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_operations.py index a2649dfbdb5a..f7018cb1b395 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImage] @@ -260,7 +265,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImage] @@ -494,7 +499,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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-07-01")) # type: str + 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.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -675,7 +680,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _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: str + 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.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py index 24d8487574c5..2eaca32df37c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._gallery_sharing_profile_operations import build_update_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.SharingUpdate] @@ -229,7 +234,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py index 1572aab7b2f8..1f3c197c45bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-07-01")) # type: str + 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.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _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: str + 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.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_log_analytics_operations.py index 32053ba814be..353311094d03 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_operations.py index 2cf5450ea162..d3e730d0eb3f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _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: str + 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.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_proximity_placement_groups_operations.py index 87aa81315dab..c08ee8178096 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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-07-01")) # type: str + 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.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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: str + 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.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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-07-01")) # type: str + 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[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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-07-01")) # type: str + 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.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _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: str + 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.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ 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", "2021-07-01")) # type: str + 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.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_resource_skus_operations.py index 36eb3af3cd5b..01407de71ea0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._resource_skus_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]] @@ -73,7 +78,7 @@ 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", "2021-07-01")) # type: str + 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.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py index 98c5a62d3fb2..c861f7b35bd7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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-07-01")) # type: str + 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.RestorePointCollection] @@ -302,7 +307,7 @@ 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: str + 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.RestorePointCollection] @@ -362,7 +367,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -418,7 +423,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -490,7 +495,7 @@ 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-07-01")) # type: str + 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.RestorePointCollection] request = build_get_request( @@ -541,7 +546,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _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: str + 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.RestorePointCollectionListResult] error_map = { @@ -625,7 +630,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _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: str + 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.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py index 129b5e651030..f0680356df3e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_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]] @@ -71,7 +76,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.RestorePoint] @@ -236,7 +241,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +299,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -352,7 +357,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -419,7 +424,7 @@ 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-07-01")) # type: str + 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.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_operations.py index 875730800d21..17ce2aab5067 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_galleries_operations import build_get_request, 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]] @@ -73,7 +78,7 @@ 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", "2021-07-01")) # type: str + 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.SharedGalleryList] error_map = { @@ -166,7 +171,7 @@ async def get(self, location: str, gallery_unique_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", "2021-07-01")) # type: str + 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.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py index f0b5e4df639c..bab64467674f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_image_versions_operations import build_get_request, 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]] @@ -84,7 +89,7 @@ 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", "2021-07-01")) # type: str + 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.SharedGalleryImageVersionList] error_map = { @@ -194,7 +199,7 @@ 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-07-01")) # type: str + 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.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py index 98693f25d923..4974b1b3405d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_images_operations import build_get_request, 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]] @@ -79,7 +84,7 @@ 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", "2021-07-01")) # type: str + 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.SharedGalleryImageList] error_map = { @@ -178,7 +183,7 @@ 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-07-01")) # type: str + 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.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_ssh_public_keys_operations.py index 0db2d2f7fcc8..9e22b7d57b36 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _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: str + 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.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ 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", "2021-07-01")) # type: str + 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.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ 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", "2021-07-01")) # type: str + 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.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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: str + 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.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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-07-01")) # type: str + 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[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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-07-01")) # type: str + 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.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _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: str + 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.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_usage_operations.py index 2dc1c930227c..d9a42cbaaea0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _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: str + 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.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extension_images_operations.py index ed6c18dfb8a1..c57c10f26277 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-07-01")) # type: str + 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.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py index f0925d58ff9c..cf8e739ae01b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-07-01")) # type: str + 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.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2021-07-01")) # type: str + 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.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index 34889416e642..87de68573228 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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-07-01")) # type: str + 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.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ 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", "2021-07-01")) # type: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_operations.py index 504a05a880a6..e6ba8a226be1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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-07-01")) # type: str + 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.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2021-07-01")) # type: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py index afa60c6cc2ee..0426cb514e95 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _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: str + 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.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2021-07-01")) # type: str + 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.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -748,7 +753,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _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: str + 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.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _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: str + 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.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 4e24b45d1dcc..39f531598138 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -612,7 +617,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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-07-01")) # type: str + 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.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index b508fbb0884a..b6db85832e1a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _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: str + 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[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _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: str + 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.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index c484c78f8049..c03b10d1cba5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ 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", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 3b1910772077..07ee6c8d3cb9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -624,7 +629,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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-07-01")) # type: str + 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.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ 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", "2021-07-01")) # type: str + 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.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 14ccea28121d..43ad1d54bde5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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-07-01")) # type: str + 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[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _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: str + 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[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -843,7 +848,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ 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-07-01")) # type: str + 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.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _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: str + 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.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ 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", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _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: str + 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.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1678,7 +1683,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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: str + 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[None] request = build_perform_maintenance_request( @@ -1736,7 +1741,7 @@ async def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def simulate_eviction( # 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-07-01")) # type: str + 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[None] request = build_simulate_eviction_request( @@ -1853,7 +1858,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -2020,7 +2025,7 @@ async def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py index 3cf44fc21cbb..5ec0114c2040 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _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: str + 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.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -671,7 +676,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,7 +749,7 @@ 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-07-01")) # type: str + 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.VirtualMachineScaleSet] request = build_get_request( @@ -797,7 +802,7 @@ async def _deallocate_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-07-01")) # type: str + 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[None] @@ -955,7 +960,7 @@ async def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1015,7 +1020,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] @@ -1177,7 +1182,7 @@ async def begin_delete_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1245,7 +1250,7 @@ async def get_instance_view( _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: str + 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.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1295,7 +1300,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _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: str + 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.VirtualMachineScaleSetListResult] error_map = { @@ -1379,7 +1384,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _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: str + 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.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1467,7 +1472,7 @@ def list_skus( _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: str + 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.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1556,7 +1561,7 @@ def get_os_upgrade_history( _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: str + 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.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1644,7 +1649,7 @@ async def _power_off_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-07-01")) # type: str + 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[None] @@ -1818,7 +1823,7 @@ async def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1878,7 +1883,7 @@ async def _restart_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-07-01")) # type: str + 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[None] @@ -2030,7 +2035,7 @@ async def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2089,7 +2094,7 @@ async def _start_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-07-01")) # type: str + 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[None] @@ -2241,7 +2246,7 @@ async def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2300,7 +2305,7 @@ async def _redeploy_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-07-01")) # type: str + 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[None] @@ -2455,7 +2460,7 @@ async def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2514,7 +2519,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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: str + 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[None] @@ -2675,7 +2680,7 @@ async def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2734,7 +2739,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] @@ -2883,7 +2888,7 @@ async def begin_update_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2942,7 +2947,7 @@ async def _reimage_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-07-01")) # type: str + 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[None] @@ -3098,7 +3103,7 @@ async def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -3157,7 +3162,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] @@ -3312,7 +3317,7 @@ async def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -3383,7 +3388,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _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: str + 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.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3513,7 +3518,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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: str + 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[None] @@ -3573,7 +3578,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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: str + 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[None] @@ -3721,7 +3726,7 @@ async def begin_set_orchestration_service_state( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_sizes_operations.py index beb0b7dfdf42..67891b207cc3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machines_operations.py index 5d4c261901fd..655c96f5fa86 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _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: str + 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.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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: str + 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.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachine] @@ -560,7 +565,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachine] @@ -768,7 +773,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -884,7 +889,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ 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-07-01")) # type: str + 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.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _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: str + 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.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _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: str + 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[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_deallocate_request( @@ -1236,7 +1241,7 @@ async def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1306,7 +1311,7 @@ async def generalize( # 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-07-01")) # type: str + 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[None] request = build_generalize_request( @@ -1352,7 +1357,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _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: str + 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.VirtualMachineListResult] error_map = { @@ -1437,7 +1442,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> AsyncIte _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: str + 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.VirtualMachineListResult] error_map = { @@ -1525,7 +1530,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { @@ -1608,7 +1613,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_power_off_request( @@ -1669,7 +1674,7 @@ async def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1722,7 +1727,7 @@ async def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_reapply_request( @@ -1775,7 +1780,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1827,7 +1832,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_restart_request( @@ -1880,7 +1885,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1932,7 +1937,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_start_request( @@ -1985,7 +1990,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2037,7 +2042,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_redeploy_request( @@ -2090,7 +2095,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2146,7 +2151,7 @@ async def _reimage_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-07-01")) # type: str + 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[None] @@ -2296,7 +2301,7 @@ async def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2371,7 +2376,7 @@ async def retrieve_boot_diagnostics_data( _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: str + 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.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2420,7 +2425,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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: str + 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[None] request = build_perform_maintenance_request( @@ -2475,7 +2480,7 @@ async def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2539,7 +2544,7 @@ async def simulate_eviction( # 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-07-01")) # type: str + 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[None] request = build_simulate_eviction_request( @@ -2583,7 +2588,7 @@ async def _assess_patches_initial( _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: str + 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[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2646,7 +2651,7 @@ async def begin_assess_patches( _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: str + 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.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2706,7 +2711,7 @@ async def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2867,7 +2872,7 @@ async def begin_install_patches( _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: str + 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.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2926,7 +2931,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -3079,7 +3084,7 @@ async def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py index c3550e97cde5..058f56ef52a8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -87,8 +92,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_availability_sets_operations.py index 800f967a0cd2..bfd776e1273a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -135,7 +140,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +171,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +227,7 @@ def build_list_available_sizes_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +361,7 @@ 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-07-01")) # type: str + 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.AvailabilitySet] @@ -492,7 +497,7 @@ 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: str + 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.AvailabilitySet] @@ -564,7 +569,7 @@ 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-07-01")) # type: str + 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[None] request = build_delete_request( @@ -618,7 +623,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _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: str + 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.AvailabilitySet] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _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: str + 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.AvailabilitySetListResult] error_map = { @@ -749,7 +754,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _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: str + 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.AvailabilitySetListResult] error_map = { @@ -836,7 +841,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservation_groups_operations.py index ad3c84bf045f..94d76baa038c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,7 +370,7 @@ 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-07-01")) # type: str + 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.CapacityReservationGroup] @@ -510,7 +515,7 @@ 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: str + 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.CapacityReservationGroup] @@ -585,7 +590,7 @@ 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-07-01")) # type: str + 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[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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-07-01")) # type: str + 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.CapacityReservationGroup] request = build_get_request( @@ -715,7 +720,7 @@ 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", "2021-07-01")) # type: str + 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.CapacityReservationGroupListResult] error_map = { @@ -807,7 +812,7 @@ 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", "2021-07-01")) # type: str + 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.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py index cf6f4d4193de..8bc054f8fa98 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -89,7 +94,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -130,7 +135,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_capacity_reservation_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.CapacityReservation] @@ -446,7 +451,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -509,7 +514,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.CapacityReservation]] @@ -676,7 +681,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -802,7 +807,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -879,7 +884,7 @@ 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-07-01")) # type: str + 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.CapacityReservation] request = build_get_request( @@ -935,7 +940,7 @@ def list_by_capacity_reservation_group( _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: str + 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.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py index 6dd4a04e0e0b..a68f6c33ea1d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -38,7 +43,7 @@ def build_get_request(location: str, public_gallery_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +111,7 @@ def get(self, location: str, public_gallery_name: 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", "2021-07-01")) # type: str + 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.CommunityGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py index b67b65cb91ca..39101e355766 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +50,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +134,7 @@ 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-07-01")) # type: str + 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.CommunityGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py index a05c67585c95..cd83dd8065e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +118,7 @@ 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-07-01")) # type: str + 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.CommunityGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py index d25601bc6984..d819f5d2918a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -109,7 +114,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -140,7 +145,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +176,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +204,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -334,7 +339,7 @@ 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-07-01")) # type: str + 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.DedicatedHostGroup] @@ -474,7 +479,7 @@ 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: str + 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.DedicatedHostGroup] @@ -546,7 +551,7 @@ 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-07-01")) # type: str + 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[None] request = build_delete_request( @@ -611,7 +616,7 @@ 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-07-01")) # type: str + 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.DedicatedHostGroup] request = build_get_request( @@ -661,7 +666,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.DedicatedHostGroupListResult] error_map = { @@ -742,7 +747,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _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: str + 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.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_hosts_operations.py index 367d6b31ba4a..69f46b426941 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_by_host_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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.DedicatedHost] @@ -409,7 +414,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -472,7 +477,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.DedicatedHost] @@ -634,7 +639,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -692,7 +697,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -750,7 +755,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -826,7 +831,7 @@ 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-07-01")) # type: str + 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.DedicatedHost] request = build_get_request( @@ -881,7 +886,7 @@ def list_by_host_group( _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: str + 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.DedicatedHostListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_galleries_operations.py index f0f1ecd4a2eb..8d92f9b28a52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -117,7 +122,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +265,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Gallery] @@ -420,7 +425,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -477,7 +482,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Gallery] @@ -628,7 +633,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -704,7 +709,7 @@ 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-07-01")) # type: str + 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.Gallery] request = build_get_request( @@ -753,7 +758,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -806,7 +811,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -858,7 +863,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryList] error_map = { @@ -938,7 +943,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _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: str + 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.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py index 9e7fae25c4c9..112678636727 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplicationVersion] @@ -480,7 +485,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplicationVersion] @@ -739,7 +744,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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-07-01")) # type: str + 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.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -951,7 +956,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _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: str + 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.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py index dd75d28a8e4e..4b7fdbc293a3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplication] @@ -424,7 +429,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplication] @@ -664,7 +669,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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-07-01")) # type: str + 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.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -847,7 +852,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _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: str + 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.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py index 2442c467b810..ef1121435bb8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImageVersion] @@ -470,7 +475,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImageVersion] @@ -728,7 +733,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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-07-01")) # type: str + 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.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -940,7 +945,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _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: str + 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.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py index fb08c7d52675..1bbeba7c28f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImage] @@ -421,7 +426,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImage] @@ -655,7 +660,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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-07-01")) # type: str + 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.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -836,7 +841,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _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: str + 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.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py index 3a5c692e29de..456b4d632092 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.SharingUpdate] @@ -263,7 +268,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py index 92932e69a724..915414b63e7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def build_update_request(resource_group_name: str, image_name: str, subscription def build_delete_request(resource_group_name: str, image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +138,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +250,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Image] @@ -394,7 +399,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -451,7 +456,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Image] @@ -600,7 +605,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -657,7 +662,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -710,7 +715,7 @@ def begin_delete(self, resource_group_name: str, image_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", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -776,7 +781,7 @@ 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-07-01")) # type: str + 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.Image] request = build_get_request( @@ -825,7 +830,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.ImageListResult] error_map = { @@ -906,7 +911,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _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: str + 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.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_log_analytics_operations.py index f5a34b2bc736..6fcc067a6344 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_operations.py index e6bd8ca60767..15dd6b347ae4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _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: str + 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.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_proximity_placement_groups_operations.py index 8923ba6637be..c383d6890ad1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +186,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +212,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ 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-07-01")) # type: str + 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.ProximityPlacementGroup] @@ -484,7 +489,7 @@ 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: str + 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.ProximityPlacementGroup] @@ -556,7 +561,7 @@ 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-07-01")) # type: str + 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[None] request = build_delete_request( @@ -619,7 +624,7 @@ 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-07-01")) # type: str + 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.ProximityPlacementGroup] request = build_get_request( @@ -668,7 +673,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _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: str + 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.ProximityPlacementGroupListResult] error_map = { @@ -753,7 +758,7 @@ 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", "2021-07-01")) # type: str + 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.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_resource_skus_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_resource_skus_operations.py index 968f1f1cc091..c20cb6a48ca6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_resource_skus_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_resource_skus_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ 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", "2021-07-01")) # type: str + 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.ResourceSkusResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py index d6419368bbbb..c4e24ef257c3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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-07-01")) # type: str + 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.RestorePointCollection] @@ -496,7 +501,7 @@ 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: str + 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.RestorePointCollection] @@ -556,7 +561,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -612,7 +617,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,7 +689,7 @@ 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-07-01")) # type: str + 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.RestorePointCollection] request = build_get_request( @@ -735,7 +740,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _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: str + 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.RestorePointCollectionListResult] error_map = { @@ -819,7 +824,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _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: str + 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.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py index e676abce8c6f..30118f75b6ce 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +130,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.RestorePoint] @@ -356,7 +361,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -414,7 +419,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -472,7 +477,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ 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-07-01")) # type: str + 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.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py index caefbdfdebbc..91cd1a81a150 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_get_request(location: str, gallery_unique_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,7 @@ 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", "2021-07-01")) # type: str + 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.SharedGalleryList] error_map = { @@ -232,7 +237,7 @@ def get(self, location: str, gallery_unique_name: 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", "2021-07-01")) # type: str + 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.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py index 5313dc91a0aa..a4f291115c16 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +92,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", "2021-07-01")) # type: str + 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.SharedGalleryImageVersionList] error_map = { @@ -274,7 +279,7 @@ 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-07-01")) # type: str + 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.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py index 28d5373c0d3c..86bce36ef406 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ 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", "2021-07-01")) # type: str + 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.SharedGalleryImageList] error_map = { @@ -249,7 +254,7 @@ 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-07-01")) # type: str + 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.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_ssh_public_keys_operations.py index 705c8155619b..aa851d824193 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,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-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -161,7 +166,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -187,7 +192,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_generate_key_pair_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _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: str + 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.SshPublicKeysGroupListResult] error_map = { @@ -363,7 +368,7 @@ 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", "2021-07-01")) # type: str + 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.SshPublicKeysGroupListResult] error_map = { @@ -521,7 +526,7 @@ 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", "2021-07-01")) # type: str + 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.SshPublicKeyResource] @@ -661,7 +666,7 @@ 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: str + 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.SshPublicKeyResource] @@ -733,7 +738,7 @@ 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-07-01")) # type: str + 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[None] request = build_delete_request( @@ -787,7 +792,7 @@ def get(self, resource_group_name: str, ssh_public_key_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", "2021-07-01")) # type: str + 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.SshPublicKeyResource] request = build_get_request( @@ -849,7 +854,7 @@ def generate_key_pair( _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: str + 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.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_usage_operations.py index 9b79a77b87f2..ade11d81b2ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _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: str + 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.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extension_images_operations.py index 8dbbf8dea7ec..5084b71dca87 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-07-01")) # type: str + 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.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extensions_operations.py index 545d16b553b8..d6881a2d0f5f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -111,7 +116,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -144,7 +149,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineExtension] @@ -418,7 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -481,7 +486,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineExtension] @@ -653,7 +658,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -770,7 +775,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -844,7 +849,7 @@ 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-07-01")) # type: str + 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.VirtualMachineExtension] request = build_get_request( @@ -908,7 +913,7 @@ 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", "2021-07-01")) # type: str + 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.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py index d370f36a5e6b..1deb4f6cf29c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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-07-01")) # type: str + 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.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ 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", "2021-07-01")) # type: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py index c5d5c006f1f1..6f5382dab0e7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-07-01")) # type: str + 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.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2021-07-01")) # type: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_run_commands_operations.py index 6dca314a4e2e..63c13b075125 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _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: str + 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.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _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: str + 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.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -973,7 +978,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _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: str + 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.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _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: str + 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.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py index 7559b09932ed..6c3ba9386276 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -113,7 +118,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -146,7 +151,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,7 +248,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetExtension] @@ -419,7 +424,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -482,7 +487,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetExtension] @@ -658,7 +663,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -716,7 +721,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -775,7 +780,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -849,7 +854,7 @@ 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-07-01")) # type: str + 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.VirtualMachineScaleSetExtension] request = build_get_request( @@ -905,7 +910,7 @@ 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", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 032703df81df..cdab0fc73a60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -41,7 +46,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +71,7 @@ def build_start_os_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -91,7 +96,7 @@ def build_start_extension_upgrade_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -117,7 +122,7 @@ def build_get_latest_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +180,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_cancel_request( @@ -228,7 +233,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -280,7 +285,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_start_os_upgrade_request( @@ -337,7 +342,7 @@ def begin_start_os_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -389,7 +394,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _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: str + 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[None] request = build_start_extension_upgrade_request( @@ -446,7 +451,7 @@ def begin_start_extension_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -510,7 +515,7 @@ def get_latest( _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: str + 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.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index f47d7484d873..f4dfde17b25b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -824,7 +829,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ 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", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 8a9d33972bd2..d8db1e95676c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -822,7 +827,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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-07-01")) # type: str + 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.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ 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", "2021-07-01")) # type: str + 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.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py index 62198ffa81a4..117f0b14b57e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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: str + 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] # Construct URL _url = kwargs.pop( @@ -75,7 +80,7 @@ def build_reimage_all_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +106,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -128,7 +133,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -168,7 +173,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -203,7 +208,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +242,7 @@ def build_get_instance_view_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -276,7 +281,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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -348,7 +353,7 @@ def build_restart_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -374,7 +379,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -400,7 +405,7 @@ def build_redeploy_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -433,7 +438,7 @@ def build_retrieve_boot_diagnostics_data_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -468,7 +473,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -494,7 +499,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -521,7 +526,7 @@ def build_run_command_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: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -588,7 +593,7 @@ def _reimage_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-07-01")) # type: str + 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[None] @@ -750,7 +755,7 @@ def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -806,7 +811,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_reimage_all_request( @@ -865,7 +870,7 @@ def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -918,7 +923,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_deallocate_request( @@ -978,7 +983,7 @@ def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVM] @@ -1210,7 +1215,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1273,7 +1278,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -1340,7 +1345,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1417,7 +1422,7 @@ 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-07-01")) # type: str + 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.VirtualMachineScaleSetVM] request = build_get_request( @@ -1481,7 +1486,7 @@ def get_instance_view( _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: str + 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.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1552,7 +1557,7 @@ 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", "2021-07-01")) # type: str + 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.VirtualMachineScaleSetVMListResult] error_map = { @@ -1643,7 +1648,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_power_off_request( @@ -1713,7 +1718,7 @@ def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1767,7 +1772,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_restart_request( @@ -1825,7 +1830,7 @@ def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1878,7 +1883,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_start_request( @@ -1936,7 +1941,7 @@ def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1989,7 +1994,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_redeploy_request( @@ -2048,7 +2053,7 @@ def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2125,7 +2130,7 @@ def retrieve_boot_diagnostics_data( _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: str + 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.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2175,7 +2180,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_perform_maintenance_request( @@ -2233,7 +2238,7 @@ def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2300,7 +2305,7 @@ def simulate_eviction( # 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-07-01")) # type: str + 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[None] request = build_simulate_eviction_request( @@ -2350,7 +2355,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -2514,7 +2519,7 @@ def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py index 293a51a18d8f..2686e55a32d1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -144,7 +149,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -177,7 +182,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,7 @@ def build_deallocate_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: str + 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] # Construct URL _url = kwargs.pop( @@ -246,7 +251,7 @@ def build_delete_instances_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: str + 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] # Construct URL _url = kwargs.pop( @@ -279,7 +284,7 @@ def build_get_instance_view_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,7 +341,7 @@ def build_list_all_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -364,7 +369,7 @@ def build_list_skus_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +400,7 @@ def build_get_os_upgrade_history_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -431,7 +436,7 @@ def build_power_off_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: str + 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] # Construct URL _url = kwargs.pop( @@ -464,7 +469,7 @@ def build_restart_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: str + 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] # Construct URL _url = kwargs.pop( @@ -495,7 +500,7 @@ def build_start_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: str + 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] # Construct URL _url = kwargs.pop( @@ -526,7 +531,7 @@ def build_redeploy_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: str + 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] # Construct URL _url = kwargs.pop( @@ -557,7 +562,7 @@ def build_perform_maintenance_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: str + 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] # Construct URL _url = kwargs.pop( @@ -588,7 +593,7 @@ def build_update_instances_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: str + 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] # Construct URL _url = kwargs.pop( @@ -619,7 +624,7 @@ def build_reimage_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: str + 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] # Construct URL _url = kwargs.pop( @@ -650,7 +655,7 @@ def build_reimage_all_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: str + 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] # Construct URL _url = kwargs.pop( @@ -686,7 +691,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -718,7 +723,7 @@ def build_convert_to_single_placement_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", "2021-07-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -749,7 +754,7 @@ def build_set_orchestration_service_state_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: str + 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] # Construct URL _url = kwargs.pop( @@ -810,7 +815,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _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: str + 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.VirtualMachineScaleSetListResult] error_map = { @@ -896,7 +901,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSet] @@ -1054,7 +1059,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1115,7 +1120,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSet] @@ -1269,7 +1274,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1326,7 +1331,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -1385,7 +1390,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1458,7 +1463,7 @@ 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-07-01")) # type: str + 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.VirtualMachineScaleSet] request = build_get_request( @@ -1511,7 +1516,7 @@ def _deallocate_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-07-01")) # type: str + 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[None] @@ -1669,7 +1674,7 @@ def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1729,7 +1734,7 @@ def _delete_instances_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-07-01")) # type: str + 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[None] @@ -1891,7 +1896,7 @@ def begin_delete_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1959,7 +1964,7 @@ def get_instance_view( _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: str + 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.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2009,7 +2014,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _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: str + 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.VirtualMachineScaleSetListResult] error_map = { @@ -2093,7 +2098,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _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: str + 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.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2181,7 +2186,7 @@ def list_skus( _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: str + 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.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2270,7 +2275,7 @@ def get_os_upgrade_history( _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: str + 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.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2358,7 +2363,7 @@ def _power_off_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-07-01")) # type: str + 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[None] @@ -2532,7 +2537,7 @@ def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2592,7 +2597,7 @@ def _restart_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-07-01")) # type: str + 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[None] @@ -2744,7 +2749,7 @@ def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2803,7 +2808,7 @@ def _start_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-07-01")) # type: str + 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[None] @@ -2955,7 +2960,7 @@ def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3014,7 +3019,7 @@ def _redeploy_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-07-01")) # type: str + 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[None] @@ -3169,7 +3174,7 @@ def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3228,7 +3233,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] @@ -3389,7 +3394,7 @@ def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3448,7 +3453,7 @@ def _update_instances_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-07-01")) # type: str + 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[None] @@ -3597,7 +3602,7 @@ def begin_update_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3656,7 +3661,7 @@ def _reimage_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-07-01")) # type: str + 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[None] @@ -3812,7 +3817,7 @@ def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3871,7 +3876,7 @@ def _reimage_all_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-07-01")) # type: str + 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[None] @@ -4026,7 +4031,7 @@ def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -4097,7 +4102,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _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: str + 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.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4227,7 +4232,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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", "2021-07-01")) # type: str + 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[None] @@ -4287,7 +4292,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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: str + 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[None] @@ -4435,7 +4440,7 @@ def begin_set_orchestration_service_state( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_sizes_operations.py index 75ecbf66f81f..3db59a57f325 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machines_operations.py index 62d993f07880..61a98ea9785d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-07-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -174,7 +179,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -207,7 +212,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +245,7 @@ def build_instance_view_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,7 +275,7 @@ def build_convert_to_managed_disks_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -295,7 +300,7 @@ def build_deallocate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -322,7 +327,7 @@ def build_generalize_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -346,7 +351,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_all_request(subscription_id: str, *, status_only: Optional[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", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -402,7 +407,7 @@ def build_list_available_sizes_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ def build_power_off_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -458,7 +463,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -486,7 +491,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i def build_restart_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -509,7 +514,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i def build_start_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -532,7 +537,7 @@ def build_start_request(resource_group_name: str, vm_name: str, subscription_id: def build_redeploy_request(resource_group_name: str, vm_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -556,7 +561,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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] # Construct URL _url = kwargs.pop( @@ -592,7 +597,7 @@ def build_retrieve_boot_diagnostics_data_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -626,7 +631,7 @@ def build_perform_maintenance_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -651,7 +656,7 @@ def build_simulate_eviction_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -677,7 +682,7 @@ def build_assess_patches_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -708,7 +713,7 @@ def build_install_patches_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: str + 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] accept = _headers.pop("Accept", "application/json") @@ -742,7 +747,7 @@ def build_run_command_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: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -804,7 +809,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _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: str + 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.VirtualMachineListResult] error_map = { @@ -890,7 +895,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.VirtualMachineCaptureResult]] @@ -1050,7 +1055,7 @@ def begin_capture( _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: str + 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.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1109,7 +1114,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachine] @@ -1264,7 +1269,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1321,7 +1326,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachine] @@ -1469,7 +1474,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1526,7 +1531,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_delete_request( @@ -1585,7 +1590,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1660,7 +1665,7 @@ 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-07-01")) # type: str + 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.VirtualMachine] request = build_get_request( @@ -1721,7 +1726,7 @@ def instance_view( _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: str + 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.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1769,7 +1774,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_convert_to_managed_disks_request( @@ -1823,7 +1828,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1875,7 +1880,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_deallocate_request( @@ -1935,7 +1940,7 @@ def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2005,7 +2010,7 @@ def generalize( # 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-07-01")) # type: str + 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[None] request = build_generalize_request( @@ -2050,7 +2055,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _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: str + 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.VirtualMachineListResult] error_map = { @@ -2134,7 +2139,7 @@ def list_all(self, status_only: Optional[str] = None, **kwargs: Any) -> Iterable _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: str + 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.VirtualMachineListResult] error_map = { @@ -2221,7 +2226,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { @@ -2304,7 +2309,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_power_off_request( @@ -2365,7 +2370,7 @@ def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2418,7 +2423,7 @@ def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_reapply_request( @@ -2471,7 +2476,7 @@ def begin_reapply(self, resource_group_name: str, vm_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", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2523,7 +2528,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_restart_request( @@ -2576,7 +2581,7 @@ def begin_restart(self, resource_group_name: str, vm_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", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2628,7 +2633,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_start_request( @@ -2681,7 +2686,7 @@ def begin_start(self, resource_group_name: str, vm_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", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2733,7 +2738,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_redeploy_request( @@ -2786,7 +2791,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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", "2021-07-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2842,7 +2847,7 @@ def _reimage_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-07-01")) # type: str + 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[None] @@ -2992,7 +2997,7 @@ def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3067,7 +3072,7 @@ def retrieve_boot_diagnostics_data( _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: str + 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.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3116,7 +3121,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[None] request = build_perform_maintenance_request( @@ -3169,7 +3174,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3233,7 +3238,7 @@ def simulate_eviction( # 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-07-01")) # type: str + 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[None] request = build_simulate_eviction_request( @@ -3277,7 +3282,7 @@ def _assess_patches_initial( _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: str + 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[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3340,7 +3345,7 @@ def begin_assess_patches( _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: str + 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.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3400,7 +3405,7 @@ def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3561,7 +3566,7 @@ def begin_install_patches( _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: str + 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.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3620,7 +3625,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -3770,7 +3775,7 @@ def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_configuration.py index b6372c22bee1..8f4d7d9bc5a0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-08-01") # type: str + api_version = kwargs.pop("api_version", "2021-08-01") # type: Literal["2021-08-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_metadata.json index b2bce3a417cf..db027e8b00e3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_metadata.json @@ -103,4 +103,4 @@ "disk_accesses": "DiskAccessesOperations", "disk_restore_point": "DiskRestorePointOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/_configuration.py index 34637dcbb635..3fdfc24b483e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-08-01") # type: str + api_version = kwargs.pop("api_version", "2021-08-01") # type: Literal["2021-08-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_accesses_operations.py index 36390b27ee5c..732ff3dd04b4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_encryption_sets_operations.py index a2de542f9281..94365defb2f1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ 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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_restore_point_operations.py index 7dd4d2ef7a96..3f9cd33ce005 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -156,7 +161,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -246,7 +251,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -428,7 +433,7 @@ async def begin_grant_access( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -494,7 +499,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -562,7 +567,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disks_operations.py index aa97c77bd0ec..a3ab186d4f49 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_snapshots_operations.py index 49272f293aad..f146664fc16f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_accesses_operations.py index fb8bda04044c..2e4331c54193 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_encryption_sets_operations.py index 711b2ed6439c..b250e7be237c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_restore_point_operations.py index d28702c6e7d8..19492c8626fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -313,7 +318,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -403,7 +408,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -582,7 +587,7 @@ def begin_grant_access( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -648,7 +653,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -716,7 +721,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disks_operations.py index 7d88626fc82a..aa616384ba55 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_snapshots_operations.py index 66ec55fbec26..eea368c0b4ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_08_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: Literal["2021-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_configuration.py index d8201b1a83a1..c8b02622b7bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-10-01") # type: str + api_version = kwargs.pop("api_version", "2021-10-01") # type: Literal["2021-10-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_metadata.json index d627f853a63b..04cf4fc4fb7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_metadata.json @@ -104,4 +104,4 @@ "gallery_application_versions": "GalleryApplicationVersionsOperations", "gallery_sharing_profile": "GallerySharingProfileOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/_configuration.py index 8300d3630db6..7930729a4104 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-10-01") # type: str + api_version = kwargs.pop("api_version", "2021-10-01") # type: Literal["2021-10-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_galleries_operations.py index 7b7a8a2d9b5f..ded852135d05 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -530,7 +535,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -580,7 +585,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -633,7 +638,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -685,7 +690,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -765,7 +770,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_application_versions_operations.py index dbcb0e4b08a5..ea059239b711 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_applications_operations.py index 41553330a68f..deada00879f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_image_versions_operations.py index b5bbee1c0f50..742aa163ab23 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_images_operations.py index 5c6576b97a6b..c5273367258a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_sharing_profile_operations.py index 2de672b0cf8f..f74daa2e992a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/aio/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._gallery_sharing_profile_operations import build_update_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -229,7 +234,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_galleries_operations.py index 2752dab5803f..2756f9c8ff7a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -118,7 +123,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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +158,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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +187,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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -263,7 +268,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -423,7 +428,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -480,7 +485,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -631,7 +636,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -761,7 +766,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -814,7 +819,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -866,7 +871,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -946,7 +951,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_application_versions_operations.py index b60ec2a52611..214d7f47c6db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_applications_operations.py index cb1e64b06e8d..8649b7f4241b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_image_versions_operations.py index 66cd3d97eaab..6353405d650c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_images_operations.py index 8ffa5a0d0aed..44f7c7faa109 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_sharing_profile_operations.py index 02b0058b669b..e5cea328ed29 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_10_01/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -263,7 +268,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: Literal["2021-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_configuration.py index 1de487494ebd..db079a8f6b1c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-11-01") # type: str + api_version = kwargs.pop("api_version", "2021-11-01") # type: Literal["2021-11-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_metadata.json index c03a1dbeec1d..93b154eb5b68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_metadata.json @@ -124,4 +124,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/_configuration.py index d67baf8fcac5..1aa6df0280c0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-11-01") # type: str + api_version = kwargs.pop("api_version", "2021-11-01") # type: Literal["2021-11-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_availability_sets_operations.py index 54afd6f0170d..fb2a15ed4c3f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservation_groups_operations.py index 4c33e1a58c23..856eba2b1613 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -301,7 +306,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -376,7 +381,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -443,7 +448,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -506,7 +511,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -598,7 +603,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservations_operations.py index f20725c82360..6ee3dbc82d5e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -318,7 +323,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -485,7 +490,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -744,7 +749,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_host_groups_operations.py index 47a19bba1e98..be226d4c87fa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -433,7 +438,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_hosts_operations.py index 34a8f472df41..e91a74eed2b5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -250,7 +255,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -478,7 +483,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -536,7 +541,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -594,7 +599,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -670,7 +675,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -726,7 +731,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { @@ -809,7 +814,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -870,7 +875,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_images_operations.py index 2f4cc2d5c61e..9a3db4f01f22 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_log_analytics_operations.py index 458d2e8ef3a5..67aa19f13181 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_operations.py index 90518b854edf..1622cf80e26c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_proximity_placement_groups_operations.py index 941a8f641c0b..ee6feb9301b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_point_collections_operations.py index a005776b30b3..f0621b9e62ba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -302,7 +307,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -362,7 +367,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -418,7 +423,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -490,7 +495,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -541,7 +546,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -625,7 +630,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_points_operations.py index 5859c82b9a09..15848b4f56e9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_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]] @@ -71,7 +76,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -236,7 +241,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +299,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -352,7 +357,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -427,7 +432,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_ssh_public_keys_operations.py index cc071bfa7710..efc49e5be280 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_usage_operations.py index 00f343c8b4bf..a293ef42b5cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extension_images_operations.py index 090e9f2a3f01..c069753cb886 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extensions_operations.py index 483ac078ae4b..6353be418552 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index fbdef249cc97..641642d5a634 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_operations.py index df69da6d8cbb..445ad1624504 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -170,7 +175,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -235,7 +240,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -291,7 +296,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -352,7 +357,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_run_commands_operations.py index 961270409e89..0eb2352d7d9e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 72b49fad181d..099c80639f7c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 57d50c2b7ce8..aa6b43b7f1eb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 44e1b9eec1f7..d95017069aad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index d4f00c0489e6..713a9f32d7fc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 7f6d4963a194..b6acba2cad82 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1678,7 +1683,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1736,7 +1741,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def simulate_eviction( # 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1853,7 +1858,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2020,7 +2025,7 @@ async def begin_run_command( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_sets_operations.py index ba3952019e6d..3d7f67971cf9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -671,7 +676,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,7 +749,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -797,7 +802,7 @@ async def _deallocate_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -955,7 +960,7 @@ async def begin_deallocate( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -1015,7 +1020,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1177,7 +1182,7 @@ async def begin_delete_instances( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -1245,7 +1250,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1295,7 +1300,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1379,7 +1384,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1467,7 +1472,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1556,7 +1561,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1644,7 +1649,7 @@ async def _power_off_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1818,7 +1823,7 @@ async def begin_power_off( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -1878,7 +1883,7 @@ async def _restart_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2030,7 +2035,7 @@ async def begin_restart( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -2089,7 +2094,7 @@ async def _start_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2241,7 +2246,7 @@ async def begin_start( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -2300,7 +2305,7 @@ async def _redeploy_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2455,7 +2460,7 @@ async def begin_redeploy( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -2514,7 +2519,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2675,7 +2680,7 @@ async def begin_perform_maintenance( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -2734,7 +2739,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2883,7 +2888,7 @@ async def begin_update_instances( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -2942,7 +2947,7 @@ async def _reimage_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3098,7 +3103,7 @@ async def begin_reimage( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -3157,7 +3162,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3312,7 +3317,7 @@ async def begin_reimage_all( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -3395,7 +3400,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3527,7 +3532,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3587,7 +3592,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3735,7 +3740,7 @@ async def begin_set_orchestration_service_state( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_sizes_operations.py index bc277c89c9fc..a9394bd869bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machines_operations.py index 9dd96310dddb..0f0150ed6ae0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1236,7 +1241,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1306,7 +1311,7 @@ async def generalize( # 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1359,7 +1364,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1452,7 +1457,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1541,7 +1546,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1624,7 +1629,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1685,7 +1690,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1738,7 +1743,7 @@ async def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1791,7 +1796,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1843,7 +1848,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1896,7 +1901,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1948,7 +1953,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2001,7 +2006,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2053,7 +2058,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2106,7 +2111,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2162,7 +2167,7 @@ async def _reimage_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2312,7 +2317,7 @@ async def begin_reimage( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -2387,7 +2392,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2436,7 +2441,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2491,7 +2496,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2555,7 +2560,7 @@ async def simulate_eviction( # 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2599,7 +2604,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2662,7 +2667,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2722,7 +2727,7 @@ async def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2883,7 +2888,7 @@ async def begin_install_patches( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2942,7 +2947,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3095,7 +3100,7 @@ async def begin_run_command( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/models/_models_py3.py index a57513ee0847..cb86c7cd54ef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -87,8 +92,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_availability_sets_operations.py index 02f457354b12..ad283f5544e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -228,7 +233,7 @@ def build_list_available_sizes_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -362,7 +367,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -498,7 +503,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -570,7 +575,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -673,7 +678,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -755,7 +760,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -842,7 +847,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservation_groups_operations.py index 54f0f7bd8134..35d116f277b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,7 +370,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -510,7 +515,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -585,7 +590,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -715,7 +720,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -807,7 +812,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservations_operations.py index 47916de9ca84..a83eec56e2bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -89,7 +94,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -130,7 +135,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_capacity_reservation_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -446,7 +451,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -509,7 +514,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -676,7 +681,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -802,7 +807,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -879,7 +884,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -935,7 +940,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_host_groups_operations.py index ac85ceb72036..85283298134d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +182,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +210,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -480,7 +485,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -552,7 +557,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -748,7 +753,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py index 5c46bf094dcf..1e366a41d0f3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_list_by_host_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +222,7 @@ def build_restart_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +286,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -447,7 +452,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -510,7 +515,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -672,7 +677,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -730,7 +735,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -788,7 +793,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -864,7 +869,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -919,7 +924,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { @@ -1002,7 +1007,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1063,7 +1068,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_images_operations.py index 3297f9b64393..82247651f91a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_delete_request(resource_group_name: str, image_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -400,7 +405,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -457,7 +462,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -606,7 +611,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -663,7 +668,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -716,7 +721,7 @@ def begin_delete(self, resource_group_name: str, image_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -782,7 +787,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -831,7 +836,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -912,7 +917,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_log_analytics_operations.py index b45f1c9e025b..c6b04679e877 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_operations.py index 05f840128639..73cf9bbbf7ae 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_proximity_placement_groups_operations.py index 79844f65607d..1a146286b355 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -490,7 +495,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -562,7 +567,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -674,7 +679,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -759,7 +764,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_point_collections_operations.py index 7431fdd4b37c..ca017d39f3d7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -496,7 +501,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -556,7 +561,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,7 +689,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -735,7 +740,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -819,7 +824,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_points_operations.py index ef2e836ead8e..bf88089f7fba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +200,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -360,7 +365,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -418,7 +423,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -476,7 +481,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -551,7 +556,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_ssh_public_keys_operations.py index 0458f64da26a..8b636b0626ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,7 @@ def build_generate_key_pair_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -283,7 +288,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -369,7 +374,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -527,7 +532,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -667,7 +672,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -739,7 +744,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -793,7 +798,7 @@ def get(self, resource_group_name: str, ssh_public_key_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -855,7 +860,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_usage_operations.py index 5dd44b4d63c8..3ff4daaf2d76 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extension_images_operations.py index c1d9347411e1..f5a65f0e1c16 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extensions_operations.py index 979b09f1078e..4dc3cf6efd09 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +189,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -424,7 +429,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -659,7 +664,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -717,7 +722,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -776,7 +781,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -850,7 +855,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -914,7 +919,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_edge_zone_operations.py index b5d6b60f3514..c7b38da6d764 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_operations.py index 0ed91489df97..17c32378a259 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -337,7 +342,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -402,7 +407,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -458,7 +463,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -519,7 +524,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_run_commands_operations.py index 62c880dcb10d..8d106438cc50 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_extensions_operations.py index 678ed564fcac..cc06353ffe65 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -425,7 +430,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -488,7 +493,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -664,7 +669,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -722,7 +727,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -781,7 +786,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -855,7 +860,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -911,7 +916,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 826d967a8e5c..157a6f7c5a9d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_cancel_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_start_os_upgrade_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,7 @@ def build_start_extension_upgrade_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +140,7 @@ def build_get_latest_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -246,7 +251,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -298,7 +303,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -355,7 +360,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -407,7 +412,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -464,7 +469,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +533,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 0f754ce15f82..df25cb6b68a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 3251ba39381f..518137181307 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vms_operations.py index b57f22a265b2..2e79e70d36af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_reimage_all_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_deallocate_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -184,7 +189,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +263,7 @@ def build_get_instance_view_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +302,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ def build_power_off_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_restart_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +413,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -440,7 +445,7 @@ def build_redeploy_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -478,7 +483,7 @@ def build_retrieve_boot_diagnostics_data_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -514,7 +519,7 @@ def build_perform_maintenance_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +551,7 @@ def build_simulate_eviction_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -578,7 +583,7 @@ def build_run_command_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -645,7 +650,7 @@ def _reimage_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -807,7 +812,7 @@ def begin_reimage( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -863,7 +868,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -922,7 +927,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -975,7 +980,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1035,7 +1040,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1093,7 +1098,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1267,7 +1272,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1330,7 +1335,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1397,7 +1402,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1479,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1538,7 +1543,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1609,7 +1614,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1700,7 +1705,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1770,7 +1775,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1824,7 +1829,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1882,7 +1887,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1935,7 +1940,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1993,7 +1998,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2046,7 +2051,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2105,7 +2110,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2182,7 +2187,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2232,7 +2237,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2290,7 +2295,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2357,7 +2362,7 @@ def simulate_eviction( # 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2407,7 +2412,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2571,7 +2576,7 @@ def begin_run_command( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_sets_operations.py index d8e5d987ae8b..ae769c65246f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -145,7 +150,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +188,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ def build_deallocate_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -255,7 +260,7 @@ def build_delete_instances_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -291,7 +296,7 @@ def build_get_instance_view_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ def build_list_all_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_list_skus_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -407,7 +412,7 @@ def build_get_os_upgrade_history_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -443,7 +448,7 @@ def build_power_off_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -479,7 +484,7 @@ def build_restart_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -513,7 +518,7 @@ def build_start_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -547,7 +552,7 @@ def build_redeploy_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -581,7 +586,7 @@ def build_perform_maintenance_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -615,7 +620,7 @@ def build_update_instances_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -649,7 +654,7 @@ def build_reimage_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -683,7 +688,7 @@ def build_reimage_all_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -724,7 +729,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -760,7 +765,7 @@ def build_convert_to_single_placement_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -794,7 +799,7 @@ def build_set_orchestration_service_state_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -858,7 +863,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -944,7 +949,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1102,7 +1107,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1163,7 +1168,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1317,7 +1322,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1374,7 +1379,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1433,7 +1438,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1506,7 +1511,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1559,7 +1564,7 @@ def _deallocate_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1717,7 +1722,7 @@ def begin_deallocate( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -1777,7 +1782,7 @@ def _delete_instances_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1939,7 +1944,7 @@ def begin_delete_instances( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -2007,7 +2012,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2057,7 +2062,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2141,7 +2146,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2229,7 +2234,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2318,7 +2323,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2406,7 +2411,7 @@ def _power_off_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2580,7 +2585,7 @@ def begin_power_off( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -2640,7 +2645,7 @@ def _restart_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2792,7 +2797,7 @@ def begin_restart( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -2851,7 +2856,7 @@ def _start_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3003,7 +3008,7 @@ def begin_start( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -3062,7 +3067,7 @@ def _redeploy_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3217,7 +3222,7 @@ def begin_redeploy( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -3276,7 +3281,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3437,7 +3442,7 @@ def begin_perform_maintenance( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -3496,7 +3501,7 @@ def _update_instances_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3645,7 +3650,7 @@ def begin_update_instances( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -3704,7 +3709,7 @@ def _reimage_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3860,7 +3865,7 @@ def begin_reimage( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -3919,7 +3924,7 @@ def _reimage_all_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4074,7 +4079,7 @@ def begin_reimage_all( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -4157,7 +4162,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4289,7 +4294,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4349,7 +4354,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4497,7 +4502,7 @@ def begin_set_orchestration_service_state( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_sizes_operations.py index d2f7afafadd0..d039fee8cc87 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machines_operations.py index a9785006338a..be11d2c0be6c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_11_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -175,7 +180,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +251,7 @@ def build_instance_view_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def build_convert_to_managed_disks_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_deallocate_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -341,7 +346,7 @@ def build_generalize_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +377,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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -404,7 +409,7 @@ def build_list_all_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -434,7 +439,7 @@ def build_list_available_sizes_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -465,7 +470,7 @@ def build_power_off_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -496,7 +501,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -525,7 +530,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -554,7 +559,7 @@ def build_start_request(resource_group_name: str, vm_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", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -583,7 +588,7 @@ def build_redeploy_request(resource_group_name: str, vm_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -612,7 +617,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -651,7 +656,7 @@ def build_retrieve_boot_diagnostics_data_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -686,7 +691,7 @@ def build_perform_maintenance_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -717,7 +722,7 @@ def build_simulate_eviction_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -748,7 +753,7 @@ def build_assess_patches_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -779,7 +784,7 @@ def build_install_patches_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -813,7 +818,7 @@ def build_run_command_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -875,7 +880,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -961,7 +966,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1121,7 +1126,7 @@ def begin_capture( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1180,7 +1185,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1335,7 +1340,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1392,7 +1397,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1540,7 +1545,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1597,7 +1602,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1656,7 +1661,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1731,7 +1736,7 @@ 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1792,7 +1797,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1840,7 +1845,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1894,7 +1899,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1946,7 +1951,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -2006,7 +2011,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2076,7 +2081,7 @@ def generalize( # 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2128,7 +2133,7 @@ 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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2220,7 +2225,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2308,7 +2313,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2391,7 +2396,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2452,7 +2457,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2505,7 +2510,7 @@ def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2558,7 +2563,7 @@ def begin_reapply(self, resource_group_name: str, vm_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2610,7 +2615,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2663,7 +2668,7 @@ def begin_restart(self, resource_group_name: str, vm_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2715,7 +2720,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2768,7 +2773,7 @@ def begin_start(self, resource_group_name: str, vm_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2820,7 +2825,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2873,7 +2878,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2929,7 +2934,7 @@ def _reimage_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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3079,7 +3084,7 @@ def begin_reimage( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-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] @@ -3154,7 +3159,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3203,7 +3208,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3256,7 +3261,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3320,7 +3325,7 @@ def simulate_eviction( # 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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3364,7 +3369,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3427,7 +3432,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3487,7 +3492,7 @@ def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3648,7 +3653,7 @@ def begin_install_patches( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3707,7 +3712,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3857,7 +3862,7 @@ def begin_run_command( _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-11-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01")) # type: Literal["2021-11-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_configuration.py index acc15eb3a5bb..8adf53c04044 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-12-01") # type: str + api_version = kwargs.pop("api_version", "2021-12-01") # type: Literal["2021-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_metadata.json index 9d19d80c5fc9..018a4db8cb54 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_metadata.json @@ -103,4 +103,4 @@ "disk_accesses": "DiskAccessesOperations", "disk_restore_point": "DiskRestorePointOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/_configuration.py index 8cc0e896a8cf..1f78543b7e4c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-12-01") # type: str + api_version = kwargs.pop("api_version", "2021-12-01") # type: Literal["2021-12-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_accesses_operations.py index 6da73c2a4bca..d430b6f2dbd6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_encryption_sets_operations.py index 00cdbef2ed96..9a74ebdb4601 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ 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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_restore_point_operations.py index 70b4cd323e96..cb3312256880 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -156,7 +161,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -246,7 +251,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -428,7 +433,7 @@ async def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -494,7 +499,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -562,7 +567,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disks_operations.py index fefd16017870..6686ba57d4a9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_snapshots_operations.py index 130bd74b87e8..1be9bf3755f7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_accesses_operations.py index 36680532c547..44c202e3b37f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_encryption_sets_operations.py index b30074372fe6..3f9ef6051490 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_restore_point_operations.py index f9ce2559bd0c..82848a38c9f5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -313,7 +318,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -403,7 +408,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -582,7 +587,7 @@ def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -648,7 +653,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -716,7 +721,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disks_operations.py index 0e03738e4e7f..846d765c95b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_snapshots_operations.py index a87ed7d307f8..cf7f56249a30 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_12_01/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-12-01")) # type: Literal["2021-12-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_configuration.py index 4ff45bd7d094..f135ec38952c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-01-03") # type: str + api_version = kwargs.pop("api_version", "2022-01-03") # type: Literal["2022-01-03"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_metadata.json index 0fe9a29e8973..48c3456eb96e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_metadata.json @@ -110,4 +110,4 @@ "community_gallery_images": "CommunityGalleryImagesOperations", "community_gallery_image_versions": "CommunityGalleryImageVersionsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/_configuration.py index 4757a520f1e4..746a8687a0ed 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-01-03") # type: str + api_version = kwargs.pop("api_version", "2022-01-03") # type: Literal["2022-01-03"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_galleries_operations.py index 5307d83bed40..a40d0b45535e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._community_galleries_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]] @@ -74,7 +79,7 @@ async def get(self, location: str, public_gallery_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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_image_versions_operations.py index 94129af96980..fdc70560f849 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._community_gallery_image_versions_operations import build_get_request, 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]] @@ -91,7 +96,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersion] request = build_get_request( @@ -149,7 +154,7 @@ 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_images_operations.py index 879037203e5e..346428f0db6c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_community_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._community_gallery_images_operations import build_get_request, 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]] @@ -81,7 +86,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImage] request = build_get_request( @@ -136,7 +141,7 @@ 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_galleries_operations.py index 8e2b018a3a6f..dd1a017a3105 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -530,7 +535,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -580,7 +585,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -633,7 +638,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -685,7 +690,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -765,7 +770,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_application_versions_operations.py index b71b1e3c764c..8ee49c85933d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_applications_operations.py index c3010be4e5e2..fa07cbc65ffd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_image_versions_operations.py index 5da23dac9c26..615a8979c071 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_images_operations.py index d9c5f6b7dba2..657dfb7142c4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_sharing_profile_operations.py index 7f36d963a7cb..ffd3369fae87 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._gallery_sharing_profile_operations import build_update_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -229,7 +234,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_galleries_operations.py index b0d48fc9db36..b277e87e0325 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_galleries_operations import build_get_request, 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]] @@ -73,7 +78,7 @@ 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -166,7 +171,7 @@ async def get(self, location: str, gallery_unique_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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_image_versions_operations.py index dc7d2868e640..a929f7b67d99 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_image_versions_operations import build_get_request, 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]] @@ -84,7 +89,7 @@ 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -194,7 +199,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_images_operations.py index 5b658dc5028f..2106e1eb21f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/aio/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_images_operations import build_get_request, 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]] @@ -79,7 +84,7 @@ 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -178,7 +183,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_galleries_operations.py index 46340ca885f7..6f501e98616e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -38,7 +43,7 @@ def build_get_request(location: str, public_gallery_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", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +111,7 @@ def get(self, location: str, public_gallery_name: 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_image_versions_operations.py index 2fba9c799031..58eaedb9c3a7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +168,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersion] request = build_get_request( @@ -221,7 +226,7 @@ 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_images_operations.py index cfa82d1b8949..766c41801152 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_community_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ def build_list_request(location: str, public_gallery_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", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -144,7 +149,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImage] request = build_get_request( @@ -197,7 +202,7 @@ def list(self, location: str, public_gallery_name: str, **kwargs: Any) -> Iterab _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_galleries_operations.py index a1cbd52fcf35..0808c83dd036 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -118,7 +123,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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +158,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +187,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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -263,7 +268,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -423,7 +428,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -480,7 +485,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -631,7 +636,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -761,7 +766,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -814,7 +819,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -866,7 +871,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -946,7 +951,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_application_versions_operations.py index caabcdd363df..711a6fc77af0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_applications_operations.py index 106c75d6cb25..905bd04fd1cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_image_versions_operations.py index 033e4dc5fe1a..db0167bf8465 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_images_operations.py index a18533053f2e..0873342e4e60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_sharing_profile_operations.py index 49304b640b6b..2a589a508bc7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -263,7 +268,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_galleries_operations.py index 211310595042..b98c7dd4ef60 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_get_request(location: str, gallery_unique_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", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,7 @@ 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -232,7 +237,7 @@ def get(self, location: str, gallery_unique_name: 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_image_versions_operations.py index 0b924bb6285e..85d8bb790758 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +92,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -274,7 +279,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_images_operations.py index 559e93b90620..683204e0a5f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_01_03/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,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-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ 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", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -249,7 +254,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-03")) # type: Literal["2022-01-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_configuration.py index 160ede9c59c1..12fba08e91fb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-01") # type: str + api_version = kwargs.pop("api_version", "2022-03-01") # type: Literal["2022-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_metadata.json index dd1198bf16bd..a07310ca5ac4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_metadata.json @@ -124,4 +124,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/_configuration.py index 3a48307ba761..bb83f64822b4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-01") # type: str + api_version = kwargs.pop("api_version", "2022-03-01") # type: Literal["2022-03-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_availability_sets_operations.py index ba172ec6e8a4..28e826e103af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2022-03-01")) # type: str + 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.AvailabilitySet] @@ -287,7 +292,7 @@ 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-03-01")) # type: str + 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.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _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: str + 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.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2022-03-01")) # type: str + 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.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _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: str + 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.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservation_groups_operations.py index b0e7aaa82412..f617a6e05bd2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2022-03-01")) # type: str + 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.CapacityReservationGroup] @@ -301,7 +306,7 @@ 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-03-01")) # type: str + 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.CapacityReservationGroup] @@ -376,7 +381,7 @@ 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", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -443,7 +448,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.CapacityReservationGroup] request = build_get_request( @@ -506,7 +511,7 @@ 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", "2022-03-01")) # type: str + 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.CapacityReservationGroupListResult] error_map = { @@ -598,7 +603,7 @@ 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", "2022-03-01")) # type: str + 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.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservations_operations.py index affa2bcc479f..75907c62a165 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.CapacityReservation] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -318,7 +323,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.CapacityReservation]] @@ -485,7 +490,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -611,7 +616,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.CapacityReservation] request = build_get_request( @@ -744,7 +749,7 @@ def list_by_capacity_reservation_group( _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: str + 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.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_host_groups_operations.py index 37e346e7f3c6..e8b408f9f450 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2022-03-01")) # type: str + 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.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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-03-01")) # type: str + 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.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -433,7 +438,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ 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", "2022-03-01")) # type: str + 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.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _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: str + 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.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_hosts_operations.py index cc19dd85c1f8..f8644fcfa168 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHost] @@ -250,7 +255,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHost] @@ -478,7 +483,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -536,7 +541,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -594,7 +599,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -670,7 +675,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHost] request = build_get_request( @@ -726,7 +731,7 @@ def list_by_host_group( _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: str + 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.DedicatedHostListResult] error_map = { @@ -809,7 +814,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_restart_request( @@ -870,7 +875,7 @@ async def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_images_operations.py index 23e1cb6d6b61..d3798e931e82 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _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: str + 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.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_log_analytics_operations.py index aaee06023833..2e524fb9290e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_operations.py index a858c884bcde..e6179ada61c7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _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: str + 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.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_proximity_placement_groups_operations.py index 0a784dd09fd7..fc3645b47e57 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2022-03-01")) # type: str + 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.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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-03-01")) # type: str + 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.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -429,7 +434,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _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: str + 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.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ 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", "2022-03-01")) # type: str + 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.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_point_collections_operations.py index 474e6a481575..917beda14c69 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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", "2022-03-01")) # type: str + 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.RestorePointCollection] @@ -302,7 +307,7 @@ 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-03-01")) # type: str + 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.RestorePointCollection] @@ -362,7 +367,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -418,7 +423,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -490,7 +495,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.RestorePointCollection] request = build_get_request( @@ -541,7 +546,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _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: str + 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.RestorePointCollectionListResult] error_map = { @@ -625,7 +630,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _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: str + 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.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_points_operations.py index 9ecb6aae0969..90d0a8d42cb3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_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]] @@ -71,7 +76,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.RestorePoint] @@ -236,7 +241,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +299,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -352,7 +357,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -427,7 +432,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_ssh_public_keys_operations.py index d73690b82bd8..04735a8883e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _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: str + 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.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ 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", "2022-03-01")) # type: str + 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.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ 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", "2022-03-01")) # type: str + 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.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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-03-01")) # type: str + 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.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -588,7 +593,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _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: str + 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.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_usage_operations.py index c6bae8d718ee..d6da95ea0b58 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _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: str + 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.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extension_images_operations.py index 1d2611271ab1..9048886ce733 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extensions_operations.py index bbe0590726f0..d0ab6556f025 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index 3bd5255372ed..5f8784b4eb21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ 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", "2022-03-01")) # type: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_operations.py index a9953c4a0b9d..6747878f8996 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineImage] request = build_get_request( @@ -171,7 +176,7 @@ 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", "2022-03-01")) # type: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -236,7 +241,7 @@ async def list_offers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -292,7 +297,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -353,7 +358,7 @@ async def list_skus( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( @@ -414,7 +419,7 @@ async def list_by_edge_zone( _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: str + 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.VmImagesInEdgeZoneListResult] request = build_list_by_edge_zone_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_run_commands_operations.py index 14e94cc9d323..acb89cf8dd6f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _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: str + 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.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2022-03-01")) # type: str + 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.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -748,7 +753,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _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: str + 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.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _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: str + 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.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 3bdd578fe4c1..84a20101fb41 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -612,7 +617,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 1cd137ad2143..a6ec12f7e91f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _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: str + 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[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _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: str + 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.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index d1da58cd2b30..1f7170614db6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 0808e1eb62e2..568217e4af0f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -624,7 +629,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 10a6c8020f92..4df1b315b489 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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-03-01")) # type: str + 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[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _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: str + 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[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -843,7 +848,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _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: str + 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.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _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: str + 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.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1678,7 +1683,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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: str + 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[None] request = build_perform_maintenance_request( @@ -1736,7 +1741,7 @@ async def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def simulate_eviction( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_simulate_eviction_request( @@ -1853,7 +1858,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -2020,7 +2025,7 @@ async def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_sets_operations.py index 53e3921f45f8..2eafdc345a65 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _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: str + 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.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -671,7 +676,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,7 +749,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSet] request = build_get_request( @@ -797,7 +802,7 @@ async def _deallocate_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-03-01")) # type: str + 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[None] @@ -955,7 +960,7 @@ async def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1015,7 +1020,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] @@ -1177,7 +1182,7 @@ async def begin_delete_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1245,7 +1250,7 @@ async def get_instance_view( _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: str + 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.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1295,7 +1300,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _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: str + 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.VirtualMachineScaleSetListResult] error_map = { @@ -1379,7 +1384,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _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: str + 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.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1467,7 +1472,7 @@ def list_skus( _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: str + 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.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1556,7 +1561,7 @@ def get_os_upgrade_history( _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: str + 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.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1644,7 +1649,7 @@ async def _power_off_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-03-01")) # type: str + 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[None] @@ -1818,7 +1823,7 @@ async def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1878,7 +1883,7 @@ async def _restart_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-03-01")) # type: str + 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[None] @@ -2030,7 +2035,7 @@ async def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2089,7 +2094,7 @@ async def _start_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-03-01")) # type: str + 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[None] @@ -2241,7 +2246,7 @@ async def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2300,7 +2305,7 @@ async def _redeploy_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-03-01")) # type: str + 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[None] @@ -2455,7 +2460,7 @@ async def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2514,7 +2519,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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: str + 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[None] @@ -2675,7 +2680,7 @@ async def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2734,7 +2739,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] @@ -2883,7 +2888,7 @@ async def begin_update_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2942,7 +2947,7 @@ async def _reimage_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-03-01")) # type: str + 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[None] @@ -3098,7 +3103,7 @@ async def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -3157,7 +3162,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] @@ -3312,7 +3317,7 @@ async def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -3395,7 +3400,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _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: str + 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.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3527,7 +3532,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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: str + 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[None] @@ -3587,7 +3592,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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: str + 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[None] @@ -3735,7 +3740,7 @@ async def begin_set_orchestration_service_state( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_sizes_operations.py index df22c1088ff9..9d783261d23c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machines_operations.py index 0ac2be7b24e7..149f77bc1807 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _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: str + 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.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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: str + 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.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachine] @@ -560,7 +565,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachine] @@ -768,7 +773,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -884,7 +889,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _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: str + 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.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _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: str + 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[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_deallocate_request( @@ -1236,7 +1241,7 @@ async def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1306,7 +1311,7 @@ async def generalize( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_generalize_request( @@ -1359,7 +1364,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineListResult] error_map = { @@ -1452,7 +1457,7 @@ def list_all( _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: str + 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.VirtualMachineListResult] error_map = { @@ -1541,7 +1546,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { @@ -1624,7 +1629,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_power_off_request( @@ -1685,7 +1690,7 @@ async def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1738,7 +1743,7 @@ async def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_reapply_request( @@ -1791,7 +1796,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1843,7 +1848,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_restart_request( @@ -1896,7 +1901,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1948,7 +1953,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_start_request( @@ -2001,7 +2006,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2053,7 +2058,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_redeploy_request( @@ -2106,7 +2111,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2162,7 +2167,7 @@ async def _reimage_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-03-01")) # type: str + 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[None] @@ -2312,7 +2317,7 @@ async def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2387,7 +2392,7 @@ async def retrieve_boot_diagnostics_data( _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: str + 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.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2436,7 +2441,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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: str + 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[None] request = build_perform_maintenance_request( @@ -2491,7 +2496,7 @@ async def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2555,7 +2560,7 @@ async def simulate_eviction( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_simulate_eviction_request( @@ -2599,7 +2604,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2662,7 +2667,7 @@ async def begin_assess_patches( _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: str + 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.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2722,7 +2727,7 @@ async def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2883,7 +2888,7 @@ async def begin_install_patches( _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: str + 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.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2942,7 +2947,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -3095,7 +3100,7 @@ async def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/models/_models_py3.py index e61e3d61bcf7..192eba5574bb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -87,8 +92,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs @@ -8264,7 +8269,8 @@ class VirtualMachineExtension(ResourceWithOptionalLocation): # pylint: disable= :vartype suppress_failures: bool :ivar protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :vartype protected_settings_from_key_vault: JSON + :vartype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ _validation = { @@ -8291,7 +8297,10 @@ class VirtualMachineExtension(ResourceWithOptionalLocation): # pylint: disable= "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "instance_view": {"key": "properties.instanceView", "type": "VirtualMachineExtensionInstanceView"}, "suppress_failures": {"key": "properties.suppressFailures", "type": "bool"}, - "protected_settings_from_key_vault": {"key": "properties.protectedSettingsFromKeyVault", "type": "object"}, + "protected_settings_from_key_vault": { + "key": "properties.protectedSettingsFromKeyVault", + "type": "KeyVaultSecretReference", + }, } def __init__( @@ -8309,7 +8318,7 @@ def __init__( protected_settings: Optional[JSON] = None, instance_view: Optional["_models.VirtualMachineExtensionInstanceView"] = None, suppress_failures: Optional[bool] = None, - protected_settings_from_key_vault: Optional[JSON] = None, + protected_settings_from_key_vault: Optional["_models.KeyVaultSecretReference"] = None, **kwargs ): """ @@ -8348,7 +8357,8 @@ def __init__( :paramtype suppress_failures: bool :keyword protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :paramtype protected_settings_from_key_vault: JSON + :paramtype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ super().__init__(location=location, tags=tags, **kwargs) self.force_update_tag = force_update_tag @@ -8600,7 +8610,8 @@ class VirtualMachineExtensionUpdate(UpdateResource): # pylint: disable=too-many :vartype suppress_failures: bool :ivar protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :vartype protected_settings_from_key_vault: JSON + :vartype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ _attribute_map = { @@ -8614,7 +8625,10 @@ class VirtualMachineExtensionUpdate(UpdateResource): # pylint: disable=too-many "settings": {"key": "properties.settings", "type": "object"}, "protected_settings": {"key": "properties.protectedSettings", "type": "object"}, "suppress_failures": {"key": "properties.suppressFailures", "type": "bool"}, - "protected_settings_from_key_vault": {"key": "properties.protectedSettingsFromKeyVault", "type": "object"}, + "protected_settings_from_key_vault": { + "key": "properties.protectedSettingsFromKeyVault", + "type": "KeyVaultSecretReference", + }, } def __init__( @@ -8630,7 +8644,7 @@ def __init__( settings: Optional[JSON] = None, protected_settings: Optional[JSON] = None, suppress_failures: Optional[bool] = None, - protected_settings_from_key_vault: Optional[JSON] = None, + protected_settings_from_key_vault: Optional["_models.KeyVaultSecretReference"] = None, **kwargs ): """ @@ -8663,7 +8677,8 @@ def __init__( :paramtype suppress_failures: bool :keyword protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :paramtype protected_settings_from_key_vault: JSON + :paramtype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ super().__init__(tags=tags, **kwargs) self.force_update_tag = force_update_tag @@ -10618,7 +10633,8 @@ class VirtualMachineScaleSetExtension(SubResourceReadOnly): # pylint: disable=t :vartype suppress_failures: bool :ivar protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :vartype protected_settings_from_key_vault: JSON + :vartype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ _validation = { @@ -10642,7 +10658,10 @@ class VirtualMachineScaleSetExtension(SubResourceReadOnly): # pylint: disable=t "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "provision_after_extensions": {"key": "properties.provisionAfterExtensions", "type": "[str]"}, "suppress_failures": {"key": "properties.suppressFailures", "type": "bool"}, - "protected_settings_from_key_vault": {"key": "properties.protectedSettingsFromKeyVault", "type": "object"}, + "protected_settings_from_key_vault": { + "key": "properties.protectedSettingsFromKeyVault", + "type": "KeyVaultSecretReference", + }, } def __init__( @@ -10659,7 +10678,7 @@ def __init__( protected_settings: Optional[JSON] = None, provision_after_extensions: Optional[List[str]] = None, suppress_failures: Optional[bool] = None, - protected_settings_from_key_vault: Optional[JSON] = None, + protected_settings_from_key_vault: Optional["_models.KeyVaultSecretReference"] = None, **kwargs ): """ @@ -10696,7 +10715,8 @@ def __init__( :paramtype suppress_failures: bool :keyword protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :paramtype protected_settings_from_key_vault: JSON + :paramtype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ super().__init__(**kwargs) self.name = name @@ -10835,7 +10855,8 @@ class VirtualMachineScaleSetExtensionUpdate(SubResourceReadOnly): # pylint: dis :vartype suppress_failures: bool :ivar protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :vartype protected_settings_from_key_vault: JSON + :vartype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ _validation = { @@ -10860,7 +10881,10 @@ class VirtualMachineScaleSetExtensionUpdate(SubResourceReadOnly): # pylint: dis "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "provision_after_extensions": {"key": "properties.provisionAfterExtensions", "type": "[str]"}, "suppress_failures": {"key": "properties.suppressFailures", "type": "bool"}, - "protected_settings_from_key_vault": {"key": "properties.protectedSettingsFromKeyVault", "type": "object"}, + "protected_settings_from_key_vault": { + "key": "properties.protectedSettingsFromKeyVault", + "type": "KeyVaultSecretReference", + }, } def __init__( @@ -10876,7 +10900,7 @@ def __init__( protected_settings: Optional[JSON] = None, provision_after_extensions: Optional[List[str]] = None, suppress_failures: Optional[bool] = None, - protected_settings_from_key_vault: Optional[JSON] = None, + protected_settings_from_key_vault: Optional["_models.KeyVaultSecretReference"] = None, **kwargs ): """ @@ -10911,7 +10935,8 @@ def __init__( :paramtype suppress_failures: bool :keyword protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :paramtype protected_settings_from_key_vault: JSON + :paramtype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ super().__init__(**kwargs) self.name = None @@ -13273,7 +13298,8 @@ class VirtualMachineScaleSetVMExtension(SubResourceReadOnly): # pylint: disable :vartype suppress_failures: bool :ivar protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :vartype protected_settings_from_key_vault: JSON + :vartype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ _validation = { @@ -13298,7 +13324,10 @@ class VirtualMachineScaleSetVMExtension(SubResourceReadOnly): # pylint: disable "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "instance_view": {"key": "properties.instanceView", "type": "VirtualMachineExtensionInstanceView"}, "suppress_failures": {"key": "properties.suppressFailures", "type": "bool"}, - "protected_settings_from_key_vault": {"key": "properties.protectedSettingsFromKeyVault", "type": "object"}, + "protected_settings_from_key_vault": { + "key": "properties.protectedSettingsFromKeyVault", + "type": "KeyVaultSecretReference", + }, } def __init__( @@ -13314,7 +13343,7 @@ def __init__( protected_settings: Optional[JSON] = None, instance_view: Optional["_models.VirtualMachineExtensionInstanceView"] = None, suppress_failures: Optional[bool] = None, - protected_settings_from_key_vault: Optional[JSON] = None, + protected_settings_from_key_vault: Optional["_models.KeyVaultSecretReference"] = None, **kwargs ): """ @@ -13349,7 +13378,8 @@ def __init__( :paramtype suppress_failures: bool :keyword protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :paramtype protected_settings_from_key_vault: JSON + :paramtype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ super().__init__(**kwargs) self.name = None @@ -13457,7 +13487,8 @@ class VirtualMachineScaleSetVMExtensionUpdate(SubResourceReadOnly): # pylint: d :vartype suppress_failures: bool :ivar protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :vartype protected_settings_from_key_vault: JSON + :vartype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ _validation = { @@ -13479,7 +13510,10 @@ class VirtualMachineScaleSetVMExtensionUpdate(SubResourceReadOnly): # pylint: d "settings": {"key": "properties.settings", "type": "object"}, "protected_settings": {"key": "properties.protectedSettings", "type": "object"}, "suppress_failures": {"key": "properties.suppressFailures", "type": "bool"}, - "protected_settings_from_key_vault": {"key": "properties.protectedSettingsFromKeyVault", "type": "object"}, + "protected_settings_from_key_vault": { + "key": "properties.protectedSettingsFromKeyVault", + "type": "KeyVaultSecretReference", + }, } def __init__( @@ -13494,7 +13528,7 @@ def __init__( settings: Optional[JSON] = None, protected_settings: Optional[JSON] = None, suppress_failures: Optional[bool] = None, - protected_settings_from_key_vault: Optional[JSON] = None, + protected_settings_from_key_vault: Optional["_models.KeyVaultSecretReference"] = None, **kwargs ): """ @@ -13526,7 +13560,8 @@ def __init__( :paramtype suppress_failures: bool :keyword protected_settings_from_key_vault: The extensions protected settings that are passed by reference, and consumed from key vault. - :paramtype protected_settings_from_key_vault: JSON + :paramtype protected_settings_from_key_vault: + ~azure.mgmt.compute.v2022_03_01.models.KeyVaultSecretReference """ super().__init__(**kwargs) self.name = None diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_availability_sets_operations.py index 31a01d836471..f10ee6d86c41 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -228,7 +233,7 @@ def build_list_available_sizes_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -362,7 +367,7 @@ 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", "2022-03-01")) # type: str + 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.AvailabilitySet] @@ -498,7 +503,7 @@ 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-03-01")) # type: str + 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.AvailabilitySet] @@ -570,7 +575,7 @@ 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", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -624,7 +629,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _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: str + 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.AvailabilitySet] request = build_get_request( @@ -673,7 +678,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> 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-03-01")) # type: str + 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.AvailabilitySetListResult] error_map = { @@ -755,7 +760,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _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: str + 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.AvailabilitySetListResult] error_map = { @@ -842,7 +847,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservation_groups_operations.py index af0953016646..bb84a91f1f52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,7 +370,7 @@ 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", "2022-03-01")) # type: str + 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.CapacityReservationGroup] @@ -510,7 +515,7 @@ 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-03-01")) # type: str + 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.CapacityReservationGroup] @@ -585,7 +590,7 @@ 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", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -652,7 +657,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.CapacityReservationGroup] request = build_get_request( @@ -715,7 +720,7 @@ 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", "2022-03-01")) # type: str + 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.CapacityReservationGroupListResult] error_map = { @@ -807,7 +812,7 @@ 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", "2022-03-01")) # type: str + 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.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservations_operations.py index 4c7a9cbbf998..95256d65549f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -89,7 +94,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -130,7 +135,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_capacity_reservation_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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.CapacityReservation] @@ -446,7 +451,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -509,7 +514,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.CapacityReservation]] @@ -676,7 +681,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -802,7 +807,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -879,7 +884,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.CapacityReservation] request = build_get_request( @@ -935,7 +940,7 @@ def list_by_capacity_reservation_group( _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: str + 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.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_host_groups_operations.py index 5abba2fb4e29..1e7a5f53c82a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +182,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +210,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ 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", "2022-03-01")) # type: str + 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.DedicatedHostGroup] @@ -480,7 +485,7 @@ 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-03-01")) # type: str + 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.DedicatedHostGroup] @@ -552,7 +557,7 @@ 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", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -617,7 +622,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHostGroup] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHostGroupListResult] error_map = { @@ -748,7 +753,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _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: str + 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.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_hosts_operations.py index 4c06eecbb8b2..75b62ecf27e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_list_by_host_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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +222,7 @@ def build_restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +286,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHost] @@ -447,7 +452,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -510,7 +515,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHost] @@ -672,7 +677,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -730,7 +735,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -788,7 +793,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -864,7 +869,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.DedicatedHost] request = build_get_request( @@ -919,7 +924,7 @@ def list_by_host_group( _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: str + 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.DedicatedHostListResult] error_map = { @@ -1002,7 +1007,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_restart_request( @@ -1063,7 +1068,7 @@ def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_images_operations.py index 06052f0ecdac..a860e89da35f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_delete_request(resource_group_name: str, image_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.Image] @@ -400,7 +405,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -457,7 +462,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.Image] @@ -606,7 +611,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -663,7 +668,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -716,7 +721,7 @@ def begin_delete(self, resource_group_name: str, image_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", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -782,7 +787,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.Image] request = build_get_request( @@ -831,7 +836,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.ImageListResult] error_map = { @@ -912,7 +917,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _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: str + 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.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_log_analytics_operations.py index b09835b1a05a..59d0280c8049 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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: str + 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.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_operations.py index 5ea7377e490b..d5074f671318 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _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: str + 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.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_proximity_placement_groups_operations.py index 919b06a73e3c..d823c7ba05bd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ 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", "2022-03-01")) # type: str + 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.ProximityPlacementGroup] @@ -490,7 +495,7 @@ 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-03-01")) # type: str + 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.ProximityPlacementGroup] @@ -562,7 +567,7 @@ 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", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -625,7 +630,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.ProximityPlacementGroup] request = build_get_request( @@ -674,7 +679,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _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: str + 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.ProximityPlacementGroupListResult] error_map = { @@ -759,7 +764,7 @@ 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", "2022-03-01")) # type: str + 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.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_point_collections_operations.py index 09c84c30037b..9533a67526a1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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", "2022-03-01")) # type: str + 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.RestorePointCollection] @@ -496,7 +501,7 @@ 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-03-01")) # type: str + 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.RestorePointCollection] @@ -556,7 +561,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -612,7 +617,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,7 +689,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.RestorePointCollection] request = build_get_request( @@ -735,7 +740,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _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: str + 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.RestorePointCollectionListResult] error_map = { @@ -819,7 +824,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _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: str + 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.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_points_operations.py index c0e503507304..1aefb6e38303 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +200,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.RestorePoint] @@ -360,7 +365,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -418,7 +423,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -476,7 +481,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -551,7 +556,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_ssh_public_keys_operations.py index c715160f8d5e..59125b12feb9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,7 @@ def build_generate_key_pair_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -283,7 +288,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _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: str + 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.SshPublicKeysGroupListResult] error_map = { @@ -369,7 +374,7 @@ 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", "2022-03-01")) # type: str + 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.SshPublicKeysGroupListResult] error_map = { @@ -527,7 +532,7 @@ 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", "2022-03-01")) # type: str + 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.SshPublicKeyResource] @@ -667,7 +672,7 @@ 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-03-01")) # type: str + 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.SshPublicKeyResource] @@ -739,7 +744,7 @@ 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", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -793,7 +798,7 @@ def get(self, resource_group_name: str, ssh_public_key_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", "2022-03-01")) # type: str + 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.SshPublicKeyResource] request = build_get_request( @@ -855,7 +860,7 @@ def generate_key_pair( _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: str + 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.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_usage_operations.py index 9172038e739e..3e5982131bf5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _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: str + 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.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extension_images_operations.py index af3b88de3f7d..82f026d18a28 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _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: str + 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[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extensions_operations.py index 8e03ce4a011d..a6507f9d8c7a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +189,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtension] @@ -424,7 +429,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtension] @@ -659,7 +664,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -717,7 +722,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -776,7 +781,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -850,7 +855,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineExtension] request = build_get_request( @@ -914,7 +919,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_edge_zone_operations.py index 11e15434eaf1..71c50bfaf3d5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ 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", "2022-03-01")) # type: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_operations.py index 5d7e19dcba5d..a9831384ec31 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ def build_list_by_edge_zone_request(location: str, edge_zone: 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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +289,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineImage] request = build_get_request( @@ -366,7 +371,7 @@ 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", "2022-03-01")) # type: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -431,7 +436,7 @@ def list_offers( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -487,7 +492,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -548,7 +553,7 @@ def list_skus( _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: str + 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[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( @@ -607,7 +612,7 @@ def list_by_edge_zone(self, location: str, edge_zone: str, **kwargs: Any) -> _mo _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: str + 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.VmImagesInEdgeZoneListResult] request = build_list_by_edge_zone_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_run_commands_operations.py index 216aa3d3c646..e1897265d28e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _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: str + 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.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _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: str + 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.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -973,7 +978,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _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: str + 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.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _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: str + 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.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_extensions_operations.py index 64e1ccb8aa81..86c8f2efa5dd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtension] @@ -425,7 +430,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -488,7 +493,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtension] @@ -664,7 +669,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -722,7 +727,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -781,7 +786,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -855,7 +860,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtension] request = build_get_request( @@ -911,7 +916,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index c1377e1b1157..5488f5c9537e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_cancel_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_start_os_upgrade_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,7 @@ def build_start_extension_upgrade_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +140,7 @@ def build_get_latest_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_cancel_request( @@ -246,7 +251,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -298,7 +303,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_start_os_upgrade_request( @@ -355,7 +360,7 @@ def begin_start_os_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -407,7 +412,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _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: str + 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[None] request = build_start_extension_upgrade_request( @@ -464,7 +469,7 @@ def begin_start_extension_upgrade( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +533,7 @@ def get_latest( _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: str + 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.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index fb20c443aded..a3796423339d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -824,7 +829,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 560f95cebc81..fd20a098c218 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -822,7 +827,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vms_operations.py index 2d132133f95b..e4277af34504 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_reimage_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_deallocate_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -184,7 +189,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +263,7 @@ def build_get_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +302,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ def build_power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_restart_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +413,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -440,7 +445,7 @@ def build_redeploy_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -478,7 +483,7 @@ def build_retrieve_boot_diagnostics_data_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -514,7 +519,7 @@ def build_perform_maintenance_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +551,7 @@ def build_simulate_eviction_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -578,7 +583,7 @@ def build_run_command_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -645,7 +650,7 @@ def _reimage_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-03-01")) # type: str + 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[None] @@ -807,7 +812,7 @@ def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -863,7 +868,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_reimage_all_request( @@ -922,7 +927,7 @@ def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -975,7 +980,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_deallocate_request( @@ -1035,7 +1040,7 @@ def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1093,7 +1098,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVM] @@ -1267,7 +1272,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1330,7 +1335,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -1397,7 +1402,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1479,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVM] request = build_get_request( @@ -1538,7 +1543,7 @@ def get_instance_view( _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: str + 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.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1609,7 +1614,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineScaleSetVMListResult] error_map = { @@ -1700,7 +1705,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_power_off_request( @@ -1770,7 +1775,7 @@ def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1824,7 +1829,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_restart_request( @@ -1882,7 +1887,7 @@ def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1935,7 +1940,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_start_request( @@ -1993,7 +1998,7 @@ def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2046,7 +2051,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_redeploy_request( @@ -2105,7 +2110,7 @@ def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2182,7 +2187,7 @@ def retrieve_boot_diagnostics_data( _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: str + 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.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2232,7 +2237,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_perform_maintenance_request( @@ -2290,7 +2295,7 @@ def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2357,7 +2362,7 @@ def simulate_eviction( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_simulate_eviction_request( @@ -2407,7 +2412,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -2571,7 +2576,7 @@ def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_sets_operations.py index d0105062091b..627f5eed9a07 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -145,7 +150,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +188,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ def build_deallocate_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -255,7 +260,7 @@ def build_delete_instances_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -291,7 +296,7 @@ def build_get_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ def build_list_all_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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_list_skus_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -407,7 +412,7 @@ def build_get_os_upgrade_history_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -443,7 +448,7 @@ def build_power_off_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -479,7 +484,7 @@ def build_restart_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -513,7 +518,7 @@ def build_start_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -547,7 +552,7 @@ def build_redeploy_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -581,7 +586,7 @@ def build_perform_maintenance_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -615,7 +620,7 @@ def build_update_instances_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -649,7 +654,7 @@ def build_reimage_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -683,7 +688,7 @@ def build_reimage_all_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -724,7 +729,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -760,7 +765,7 @@ def build_convert_to_single_placement_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", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -794,7 +799,7 @@ def build_set_orchestration_service_state_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -858,7 +863,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _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: str + 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.VirtualMachineScaleSetListResult] error_map = { @@ -944,7 +949,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSet] @@ -1102,7 +1107,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1163,7 +1168,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSet] @@ -1317,7 +1322,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1374,7 +1379,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -1433,7 +1438,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1506,7 +1511,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachineScaleSet] request = build_get_request( @@ -1559,7 +1564,7 @@ def _deallocate_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-03-01")) # type: str + 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[None] @@ -1717,7 +1722,7 @@ def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1777,7 +1782,7 @@ def _delete_instances_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-03-01")) # type: str + 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[None] @@ -1939,7 +1944,7 @@ def begin_delete_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2007,7 +2012,7 @@ def get_instance_view( _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: str + 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.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2057,7 +2062,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _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: str + 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.VirtualMachineScaleSetListResult] error_map = { @@ -2141,7 +2146,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _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: str + 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.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2229,7 +2234,7 @@ def list_skus( _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: str + 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.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2318,7 +2323,7 @@ def get_os_upgrade_history( _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: str + 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.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2406,7 +2411,7 @@ def _power_off_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-03-01")) # type: str + 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[None] @@ -2580,7 +2585,7 @@ def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2640,7 +2645,7 @@ def _restart_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-03-01")) # type: str + 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[None] @@ -2792,7 +2797,7 @@ def begin_restart( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -2851,7 +2856,7 @@ def _start_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-03-01")) # type: str + 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[None] @@ -3003,7 +3008,7 @@ def begin_start( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3062,7 +3067,7 @@ def _redeploy_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-03-01")) # type: str + 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[None] @@ -3217,7 +3222,7 @@ def begin_redeploy( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3276,7 +3281,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] @@ -3437,7 +3442,7 @@ def begin_perform_maintenance( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3496,7 +3501,7 @@ def _update_instances_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-03-01")) # type: str + 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[None] @@ -3645,7 +3650,7 @@ def begin_update_instances( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3704,7 +3709,7 @@ def _reimage_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-03-01")) # type: str + 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[None] @@ -3860,7 +3865,7 @@ def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3919,7 +3924,7 @@ def _reimage_all_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-03-01")) # type: str + 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[None] @@ -4074,7 +4079,7 @@ def begin_reimage_all( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -4157,7 +4162,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _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: str + 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.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4289,7 +4294,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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", "2022-03-01")) # type: str + 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[None] @@ -4349,7 +4354,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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: str + 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[None] @@ -4497,7 +4502,7 @@ def begin_set_orchestration_service_state( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_sizes_operations.py index 96f5f015e494..202df7592edc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _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: str + 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.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machines_operations.py index c8d4d082fcc5..00a5be225768 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -175,7 +180,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +251,7 @@ def build_instance_view_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def build_convert_to_managed_disks_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_deallocate_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -341,7 +346,7 @@ def build_generalize_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +377,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", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -404,7 +409,7 @@ def build_list_all_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -434,7 +439,7 @@ def build_list_available_sizes_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -465,7 +470,7 @@ def build_power_off_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -496,7 +501,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -525,7 +530,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -554,7 +559,7 @@ def build_start_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -583,7 +588,7 @@ def build_redeploy_request(resource_group_name: str, vm_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -612,7 +617,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -651,7 +656,7 @@ def build_retrieve_boot_diagnostics_data_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -686,7 +691,7 @@ def build_perform_maintenance_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -717,7 +722,7 @@ def build_simulate_eviction_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -748,7 +753,7 @@ def build_assess_patches_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-03-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -779,7 +784,7 @@ def build_install_patches_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json") @@ -813,7 +818,7 @@ def build_run_command_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-03-01")) # type: str + 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] accept = _headers.pop("Accept", "application/json, text/json") @@ -875,7 +880,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _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: str + 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.VirtualMachineListResult] error_map = { @@ -961,7 +966,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.VirtualMachineCaptureResult]] @@ -1121,7 +1126,7 @@ def begin_capture( _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: str + 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.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1180,7 +1185,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachine] @@ -1335,7 +1340,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1392,7 +1397,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachine] @@ -1540,7 +1545,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1597,7 +1602,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_delete_request( @@ -1656,7 +1661,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1731,7 +1736,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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.VirtualMachine] request = build_get_request( @@ -1792,7 +1797,7 @@ def instance_view( _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: str + 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.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1840,7 +1845,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_convert_to_managed_disks_request( @@ -1894,7 +1899,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1946,7 +1951,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_deallocate_request( @@ -2006,7 +2011,7 @@ def begin_deallocate( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2076,7 +2081,7 @@ def generalize( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_generalize_request( @@ -2128,7 +2133,7 @@ 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", "2022-03-01")) # type: str + 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.VirtualMachineListResult] error_map = { @@ -2220,7 +2225,7 @@ def list_all( _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: str + 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.VirtualMachineListResult] error_map = { @@ -2308,7 +2313,7 @@ def list_available_sizes( _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: str + 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.VirtualMachineSizeListResult] error_map = { @@ -2391,7 +2396,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_power_off_request( @@ -2452,7 +2457,7 @@ def begin_power_off( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2505,7 +2510,7 @@ def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_reapply_request( @@ -2558,7 +2563,7 @@ def begin_reapply(self, resource_group_name: str, vm_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", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2610,7 +2615,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_restart_request( @@ -2663,7 +2668,7 @@ def begin_restart(self, resource_group_name: str, vm_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", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2715,7 +2720,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_start_request( @@ -2768,7 +2773,7 @@ def begin_start(self, resource_group_name: str, vm_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", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2820,7 +2825,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_redeploy_request( @@ -2873,7 +2878,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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", "2022-03-01")) # type: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2929,7 +2934,7 @@ def _reimage_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-03-01")) # type: str + 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[None] @@ -3079,7 +3084,7 @@ def begin_reimage( _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3154,7 +3159,7 @@ def retrieve_boot_diagnostics_data( _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: str + 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.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3203,7 +3208,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_perform_maintenance_request( @@ -3256,7 +3261,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _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: str + 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[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3320,7 +3325,7 @@ def simulate_eviction( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[None] request = build_simulate_eviction_request( @@ -3364,7 +3369,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3427,7 +3432,7 @@ def begin_assess_patches( _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: str + 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.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3487,7 +3492,7 @@ def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3648,7 +3653,7 @@ def begin_install_patches( _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: str + 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.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3707,7 +3712,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str + 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[Optional[_models.RunCommandResult]] @@ -3857,7 +3862,7 @@ def begin_run_command( _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: str + 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.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_configuration.py index 1bd61b67a16c..0e2544bc13ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-02") # type: str + api_version = kwargs.pop("api_version", "2022-03-02") # type: Literal["2022-03-02"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_metadata.json index a6c3aee92021..c82fbfdf49e0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_metadata.json @@ -103,4 +103,4 @@ "disk_restore_point": "DiskRestorePointOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/_configuration.py index d23c2786eb08..b49afa6d94aa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-02") # type: str + api_version = kwargs.pop("api_version", "2022-03-02") # type: Literal["2022-03-02"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_accesses_operations.py index 1ca694e17cd7..4da61e704a5a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_encryption_sets_operations.py index 278cc39e93fa..759fa3ef3807 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ 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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_restore_point_operations.py index 49b827c6ff8a..a9ebe968bc71 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -156,7 +161,7 @@ def list_by_restore_point( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -246,7 +251,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -428,7 +433,7 @@ async def begin_grant_access( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -494,7 +499,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -562,7 +567,7 @@ async def begin_revoke_access( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disks_operations.py index bc183505b704..02e8151c8e00 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_snapshots_operations.py index 93de92b775d7..83eb7ba869aa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_accesses_operations.py index e60d0faddbcd..03b48ffd6132 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_encryption_sets_operations.py index f6f49c2c407d..76c8af780b15 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_restore_point_operations.py index 6d432926daf6..4d4a3a1573ca 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -313,7 +318,7 @@ def list_by_restore_point( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -403,7 +408,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -582,7 +587,7 @@ def begin_grant_access( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -648,7 +653,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -716,7 +721,7 @@ def begin_revoke_access( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disks_operations.py index abdc7bdfcf18..b824fd77e2a2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_snapshots_operations.py index 8131a1e7a940..9b6a68ec1e71 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_02/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _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-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02")) # type: Literal["2022-03-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_configuration.py index d01841a7fb05..216f3db6de70 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-03") # type: str + api_version = kwargs.pop("api_version", "2022-03-03") # type: Literal["2022-03-03"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_metadata.json index 9af32c2ac69d..f8107ab6b5d1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_metadata.json @@ -110,4 +110,4 @@ "community_gallery_images": "CommunityGalleryImagesOperations", "community_gallery_image_versions": "CommunityGalleryImageVersionsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_configuration.py index aebb5d655c51..d4ee1e82d4ef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-03") # type: str + api_version = kwargs.pop("api_version", "2022-03-03") # type: Literal["2022-03-03"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_galleries_operations.py index 5b434cf2db06..390635b792fa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._community_galleries_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]] @@ -74,7 +79,7 @@ async def get(self, location: str, public_gallery_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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_image_versions_operations.py index ab91f5a61b64..044f075d9085 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._community_gallery_image_versions_operations import build_get_request, 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]] @@ -91,7 +96,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersion] request = build_get_request( @@ -149,7 +154,7 @@ 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_images_operations.py index 9b79a3c0fbdf..61e3c70b46ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_community_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._community_gallery_images_operations import build_get_request, 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]] @@ -81,7 +86,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImage] request = build_get_request( @@ -136,7 +141,7 @@ 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_galleries_operations.py index 5f884d927d17..bcb9ae874bbe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -239,7 +244,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -296,7 +301,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -450,7 +455,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -530,7 +535,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -580,7 +585,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -633,7 +638,7 @@ async def begin_delete(self, resource_group_name: str, gallery_name: str, **kwar _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -685,7 +690,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -765,7 +770,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Gallery"]: _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_application_versions_operations.py index 0851a88396d0..020dd1f7fdd5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -282,7 +287,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -347,7 +352,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -541,7 +546,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -628,7 +633,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -684,7 +689,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -753,7 +758,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ def list_by_gallery_application( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_applications_operations.py index 95d5b5a5e757..9302d2a3f24a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -263,7 +268,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -503,7 +508,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -577,7 +582,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -626,7 +631,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -686,7 +691,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -745,7 +750,7 @@ def list_by_gallery( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_image_versions_operations.py index cc25480b1dfc..515d79002b25 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -280,7 +285,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -345,7 +350,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -538,7 +543,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -625,7 +630,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -681,7 +686,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -750,7 +755,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -813,7 +818,7 @@ def list_by_gallery_image( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_images_operations.py index ea35c2799906..c13bc35917e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -260,7 +265,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -323,7 +328,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -494,7 +499,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -567,7 +572,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -616,7 +621,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -675,7 +680,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -734,7 +739,7 @@ def list_by_gallery( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_sharing_profile_operations.py index 9889f73c0e29..c41b45b48d10 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._gallery_sharing_profile_operations import build_update_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -229,7 +234,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_galleries_operations.py index 21ca90fcc9c1..a429904fa28f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_galleries_operations import build_get_request, 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]] @@ -73,7 +78,7 @@ 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -166,7 +171,7 @@ async def get(self, location: str, gallery_unique_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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_image_versions_operations.py index 503696d8cd5c..cdebb7738d39 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_image_versions_operations import build_get_request, 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]] @@ -84,7 +89,7 @@ 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -194,7 +199,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_images_operations.py index 7ce8b02334c1..b263386a67a3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/aio/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._shared_gallery_images_operations import build_get_request, 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]] @@ -79,7 +84,7 @@ 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -178,7 +183,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/__init__.py index 164dff985f0f..f422ff787215 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/__init__.py @@ -18,6 +18,7 @@ from ._models_py3 import Disallowed from ._models_py3 import DiskImageEncryption from ._models_py3 import EncryptionImages +from ._models_py3 import ExtendedLocation from ._models_py3 import Gallery from ._models_py3 import GalleryApplication from ._models_py3 import GalleryApplicationCustomAction @@ -70,6 +71,7 @@ from ._models_py3 import ReplicationStatus from ._models_py3 import Resource from ._models_py3 import ResourceRange +from ._models_py3 import ResourceWithOptionalLocation from ._models_py3 import SharedGallery from ._models_py3 import SharedGalleryDataDiskImage from ._models_py3 import SharedGalleryDiskImage @@ -85,15 +87,20 @@ from ._models_py3 import SharingStatus from ._models_py3 import SharingUpdate from ._models_py3 import SoftDeletePolicy +from ._models_py3 import SubResource +from ._models_py3 import SubResourceReadOnly +from ._models_py3 import SystemData from ._models_py3 import TargetRegion from ._models_py3 import UpdateResourceDefinition from ._models_py3 import UserArtifactManage from ._models_py3 import UserArtifactSettings from ._models_py3 import UserArtifactSource +from ._models_py3 import UserAssignedIdentitiesValue from ._compute_management_client_enums import AggregatedReplicationState from ._compute_management_client_enums import Architecture from ._compute_management_client_enums import ConfidentialVMEncryptionType +from ._compute_management_client_enums import ExtendedLocationTypes from ._compute_management_client_enums import GalleryApplicationCustomActionParameterType from ._compute_management_client_enums import GalleryExpandParams from ._compute_management_client_enums import GalleryExtendedLocationType @@ -131,6 +138,7 @@ "Disallowed", "DiskImageEncryption", "EncryptionImages", + "ExtendedLocation", "Gallery", "GalleryApplication", "GalleryApplicationCustomAction", @@ -183,6 +191,7 @@ "ReplicationStatus", "Resource", "ResourceRange", + "ResourceWithOptionalLocation", "SharedGallery", "SharedGalleryDataDiskImage", "SharedGalleryDiskImage", @@ -198,14 +207,19 @@ "SharingStatus", "SharingUpdate", "SoftDeletePolicy", + "SubResource", + "SubResourceReadOnly", + "SystemData", "TargetRegion", "UpdateResourceDefinition", "UserArtifactManage", "UserArtifactSettings", "UserArtifactSource", + "UserAssignedIdentitiesValue", "AggregatedReplicationState", "Architecture", "ConfidentialVMEncryptionType", + "ExtendedLocationTypes", "GalleryApplicationCustomActionParameterType", "GalleryExpandParams", "GalleryExtendedLocationType", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_compute_management_client_enums.py index 0384ea6c9b6b..e53b4c3f8cf8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_compute_management_client_enums.py @@ -34,6 +34,12 @@ class ConfidentialVMEncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta) ENCRYPTED_WITH_CMK = "EncryptedWithCmk" +class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of extendedLocation.""" + + EDGE_ZONE = "EdgeZone" + + class GalleryApplicationCustomActionParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_models_py3.py index 4914ea0f3cdb..95fb98c23a7f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/models/_models_py3.py @@ -650,6 +650,38 @@ def __init__( self.data_disk_images = data_disk_images +class ExtendedLocation(_serialization.Model): + """The complex type of the extended location. + + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. "EdgeZone" + :vartype type: str or ~azure.mgmt.compute.v2022_03_03.models.ExtendedLocationTypes + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = None, + **kwargs + ): + """ + :keyword name: The name of the extended location. + :paramtype name: str + :keyword type: The type of the extended location. "EdgeZone" + :paramtype type: str or ~azure.mgmt.compute.v2022_03_03.models.ExtendedLocationTypes + """ + super().__init__(**kwargs) + self.name = name + self.type = type + + class Resource(_serialization.Model): """The Resource model definition. @@ -3471,6 +3503,52 @@ def __init__( self.max = max +class ResourceWithOptionalLocation(_serialization.Model): + """The Resource model definition with location property as optional. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Resource location. + :vartype location: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "location": {"key": "location", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs): + """ + :keyword location: Resource location. + :paramtype location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.location = location + self.id = None + self.name = None + self.type = None + self.tags = tags + + class SharedGallery(PirSharedGalleryResource): """Specifies information about the Shared Gallery that you want to create or update. @@ -4147,6 +4225,79 @@ def __init__(self, *, is_soft_delete_enabled: Optional[bool] = None, **kwargs): self.is_soft_delete_enabled = is_soft_delete_enabled +class SubResource(_serialization.Model): + """SubResource. + + :ivar id: Resource Id. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin + """ + :keyword id: Resource Id. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class SubResourceReadOnly(_serialization.Model): + """SubResourceReadOnly. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + """ + + _validation = { + "id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.id = None + + +class SystemData(_serialization.Model): + """The system meta data relating to this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: Specifies the time in UTC at which the Cloud Service (extended support) + resource was created. :code:`
`Minimum api-version: 2022-04-04. + :vartype created_at: ~datetime.datetime + :ivar last_modified_at: Specifies the time in UTC at which the Cloud Service (extended support) + resource was last modified. :code:`
`Minimum api-version: 2022-04-04. + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + "created_at": {"readonly": True}, + "last_modified_at": {"readonly": True}, + } + + _attribute_map = { + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.created_at = None + self.last_modified_at = None + + class TargetRegion(_serialization.Model): """Describes the target region information. @@ -4332,3 +4483,31 @@ def __init__(self, *, media_link: str, default_configuration_link: Optional[str] super().__init__(**kwargs) self.media_link = media_link self.default_configuration_link = default_configuration_link + + +class UserAssignedIdentitiesValue(_serialization.Model): + """UserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.principal_id = None + self.client_id = None diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_galleries_operations.py index 5de3ad7e27b9..867dd5169391 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -38,7 +43,7 @@ def build_get_request(location: str, public_gallery_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", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +111,7 @@ def get(self, location: str, public_gallery_name: 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_image_versions_operations.py index b926e22c8936..ed6269c700d8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +168,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersion] request = build_get_request( @@ -221,7 +226,7 @@ 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_images_operations.py index 2b450bc117d0..64ef0096e98f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_community_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ def build_list_request(location: str, public_gallery_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", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -144,7 +149,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImage] request = build_get_request( @@ -197,7 +202,7 @@ def list(self, location: str, public_gallery_name: str, **kwargs: Any) -> Iterab _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CommunityGalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_galleries_operations.py index d55fd27ac376..e381409d91e2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -118,7 +123,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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +158,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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +187,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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -263,7 +268,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -423,7 +428,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -480,7 +485,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] @@ -631,7 +636,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -711,7 +716,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] request = build_get_request( @@ -761,7 +766,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -814,7 +819,7 @@ def begin_delete(self, resource_group_name: str, gallery_name: str, **kwargs: An _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -866,7 +871,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { @@ -946,7 +951,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Gallery"]: _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_application_versions_operations.py index 40336d2ad725..d73617a3e732 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_application_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_application_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -92,7 +97,7 @@ 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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -137,7 +142,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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +184,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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_list_by_gallery_application_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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -480,7 +485,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -545,7 +550,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] @@ -739,7 +744,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -826,7 +831,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersion] request = build_get_request( @@ -882,7 +887,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -951,7 +956,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1015,7 +1020,7 @@ def list_by_gallery_application( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_applications_operations.py index 62887799864b..881dc6ba65df 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_applications_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_applications_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -424,7 +429,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] @@ -664,7 +669,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplication] request = build_get_request( @@ -787,7 +792,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -847,7 +852,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -905,7 +910,7 @@ def list_by_gallery( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryApplicationList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_image_versions_operations.py index 0132a5b51d79..25cb58d1f354 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -90,7 +95,7 @@ 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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -133,7 +138,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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +178,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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_gallery_image_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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -470,7 +475,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -535,7 +540,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] @@ -728,7 +733,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -815,7 +820,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersion] request = build_get_request( @@ -871,7 +876,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -940,7 +945,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1003,7 +1008,7 @@ def list_by_gallery_image( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageVersionList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_images_operations.py index 38096f8d6114..06293e83f91f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_by_gallery_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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +246,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -421,7 +426,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -484,7 +489,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] @@ -655,7 +660,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -728,7 +733,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImage] request = build_get_request( @@ -777,7 +782,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -836,7 +841,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -894,7 +899,7 @@ def list_by_gallery( _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-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryImageList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_sharing_profile_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_sharing_profile_operations.py index eb1b6b3fdb8b..2a2333f5630f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_sharing_profile_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_gallery_sharing_profile_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ 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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -107,7 +112,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] @@ -263,7 +268,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharingUpdate] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_galleries_operations.py index 3309f4cf2bc9..1d13a6a07888 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_galleries_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_galleries_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +81,7 @@ def build_get_request(location: str, gallery_unique_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", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,7 @@ 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryList] error_map = { @@ -232,7 +237,7 @@ def get(self, location: str, gallery_unique_name: 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGallery] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_image_versions_operations.py index 2f613c7f54f7..7c7e687323d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_image_versions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_image_versions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +92,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +169,7 @@ 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersionList] error_map = { @@ -274,7 +279,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageVersion] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_images_operations.py index 9740fb558790..3c52588a42ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_03_03/operations/_shared_gallery_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,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-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ 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", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImageList] error_map = { @@ -249,7 +254,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-03")) # type: Literal["2022-03-03"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SharedGalleryImage] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_configuration.py index 5b1fdf28b114..68d1330c6ff9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-04-04") # type: str + api_version = kwargs.pop("api_version", "2022-04-04") # type: Literal["2022-04-04"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_metadata.json index 9be6b0557db5..aecd339a2468 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_metadata.json @@ -103,4 +103,4 @@ "cloud_services_update_domain": "CloudServicesUpdateDomainOperations", "cloud_service_operating_systems": "CloudServiceOperatingSystemsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/_configuration.py index 556d4e3f0411..c912b60ef2ac 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-04-04") # type: str + api_version = kwargs.pop("api_version", "2022-04-04") # type: Literal["2022-04-04"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_operating_systems_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_operating_systems_operations.py index f7e658d1f27b..7f5fb3318e52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_operating_systems_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_operating_systems_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -35,6 +36,10 @@ build_list_os_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ async def get_os_version(self, location: str, os_version_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersion] request = build_get_os_version_request( @@ -134,7 +139,7 @@ def list_os_versions(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersionListResult] error_map = { @@ -227,7 +232,7 @@ async def get_os_family(self, location: str, os_family_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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamily] request = build_get_os_family_request( @@ -278,7 +283,7 @@ def list_os_families(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamilyListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_role_instances_operations.py index c2d882919190..87e8b37cb69e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse @@ -41,6 +42,10 @@ build_restart_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -136,7 +141,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -211,7 +216,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -275,7 +280,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -338,7 +343,7 @@ 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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -422,7 +427,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -481,7 +486,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -534,7 +539,7 @@ async def _reimage_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -593,7 +598,7 @@ async def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -646,7 +651,7 @@ async def _rebuild_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -706,7 +711,7 @@ async def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -773,7 +778,7 @@ async def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[AsyncIterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_roles_operations.py index 009e8edf14ec..70ea79e75f05 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._cloud_service_roles_operations import build_get_request, 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]] @@ -81,7 +86,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -136,7 +141,7 @@ 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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_operations.py index 5628224dd037..ddc2a3d3b216 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,6 +47,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -249,7 +254,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -310,7 +315,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -465,7 +470,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -577,7 +582,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -639,7 +644,7 @@ async def get(self, resource_group_name: str, cloud_service_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -699,7 +704,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -748,7 +753,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -832,7 +837,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -914,7 +919,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -969,7 +974,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1021,7 +1026,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1077,7 +1082,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1133,7 +1138,7 @@ async def _restart_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1281,7 +1286,7 @@ async def begin_restart( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -1340,7 +1345,7 @@ async def _reimage_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1491,7 +1496,7 @@ async def begin_reimage( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -1550,7 +1555,7 @@ async def _rebuild_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1704,7 +1709,7 @@ async def begin_rebuild( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -1763,7 +1768,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1911,7 +1916,7 @@ async def begin_delete_instances( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_update_domain_operations.py index e562759fafa1..5a7fb8cba2bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/aio/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -36,6 +37,10 @@ build_walk_update_domain_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _walk_update_domain_initial( # pylint: disable=inconsistent-return-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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -242,7 +247,7 @@ async def begin_walk_update_domain( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -316,7 +321,7 @@ async def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -370,7 +375,7 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/models/_models_py3.py index 61adbb389825..a3d49e565ac8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/models/_models_py3.py @@ -12,13 +12,14 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_operating_systems_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_operating_systems_operations.py index 8ade216daf6d..a03274775ea9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_operating_systems_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_operating_systems_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_get_os_version_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_os_versions_request(location: 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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +104,7 @@ def build_get_os_family_request(location: str, os_family_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +133,7 @@ def build_list_os_families_request(location: 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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -196,7 +201,7 @@ def get_os_version(self, location: str, os_version_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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersion] request = build_get_os_version_request( @@ -246,7 +251,7 @@ def list_os_versions(self, location: str, **kwargs: Any) -> Iterable["_models.OS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSVersionListResult] error_map = { @@ -339,7 +344,7 @@ def get_os_family(self, location: str, os_family_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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamily] request = build_get_os_family_request( @@ -389,7 +394,7 @@ def list_os_families(self, location: str, **kwargs: Any) -> Iterable["_models.OS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.OSFamilyListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_role_instances_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_role_instances_operations.py index 9d0a53cf6611..8a4673bef414 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_role_instances_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_role_instances_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +87,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +121,7 @@ def build_get_instance_view_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +158,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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_restart_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_reimage_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +255,7 @@ def build_rebuild_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +287,7 @@ def build_get_remote_desktop_file_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/x-rdp") # Construct URL @@ -341,7 +346,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -399,7 +404,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -474,7 +479,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstance] request = build_get_request( @@ -538,7 +543,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceView] request = build_get_instance_view_request( @@ -600,7 +605,7 @@ 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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RoleInstanceListResult] error_map = { @@ -684,7 +689,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -743,7 +748,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -796,7 +801,7 @@ def _reimage_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_request( @@ -855,7 +860,7 @@ def begin_reimage( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -908,7 +913,7 @@ def _rebuild_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_rebuild_request( @@ -968,7 +973,7 @@ def begin_rebuild( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def get_remote_desktop_file( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[Iterator[bytes]] request = build_get_remote_desktop_file_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_roles_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_roles_operations.py index 1b316fcd7da8..1a95c91227e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_roles_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_service_roles_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +79,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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRole] request = build_get_request( @@ -200,7 +205,7 @@ 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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceRoleListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_operations.py index 84db599a6ff6..280ba2eea125 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def build_get_instance_view_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +208,7 @@ def build_list_all_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -227,7 +232,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +262,7 @@ def build_start_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def build_power_off_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -319,7 +324,7 @@ def build_restart_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -353,7 +358,7 @@ def build_reimage_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -387,7 +392,7 @@ def build_rebuild_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -421,7 +426,7 @@ def build_delete_instances_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -486,7 +491,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -648,7 +653,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -709,7 +714,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] @@ -864,7 +869,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -921,7 +926,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -974,7 +979,7 @@ def begin_delete(self, resource_group_name: str, cloud_service_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1036,7 +1041,7 @@ def get(self, resource_group_name: str, cloud_service_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", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudService] request = build_get_request( @@ -1096,7 +1101,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceInstanceView] request = build_get_instance_view_request( @@ -1144,7 +1149,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.CloudService"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1227,7 +1232,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Clo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CloudServiceListResult] error_map = { @@ -1309,7 +1314,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1362,7 +1367,7 @@ def begin_start(self, resource_group_name: str, cloud_service_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1414,7 +1419,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1468,7 +1473,7 @@ def begin_power_off(self, resource_group_name: str, cloud_service_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1524,7 +1529,7 @@ def _restart_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1672,7 +1677,7 @@ def begin_restart( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -1731,7 +1736,7 @@ def _reimage_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1882,7 +1887,7 @@ def begin_reimage( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -1941,7 +1946,7 @@ def _rebuild_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2095,7 +2100,7 @@ def begin_rebuild( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -2154,7 +2159,7 @@ def _delete_instances_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2302,7 +2307,7 @@ def begin_delete_instances( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_update_domain_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_update_domain_operations.py index e30bf8dad6b8..cf623194547f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_update_domain_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_04_04/operations/_cloud_services_update_domain_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_walk_update_domain_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_get_update_domain_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_list_update_domains_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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +179,7 @@ def _walk_update_domain_initial( # pylint: disable=inconsistent-return-statemen _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -338,7 +343,7 @@ def begin_walk_update_domain( _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-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] 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] @@ -412,7 +417,7 @@ def get_update_domain( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomain] request = build_get_update_domain_request( @@ -465,7 +470,7 @@ def list_update_domains( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-04")) # type: Literal["2022-04-04"] cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateDomainListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_configuration.py index 082bd39d5c3c..f31f5a04c8d4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-07-02") # type: str + api_version = kwargs.pop("api_version", "2022-07-02") # type: Literal["2022-07-02"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_metadata.json index e0fd1031417e..ac8e66311db5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_metadata.json @@ -103,4 +103,4 @@ "disk_restore_point": "DiskRestorePointOperations", "snapshots": "SnapshotsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_configuration.py index 37e73c404b6a..d4ce6452f099 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-07-02") # type: str + api_version = kwargs.pop("api_version", "2022-07-02") # type: Literal["2022-07-02"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_accesses_operations.py index 9b6a17b69382..657130ffaa26 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -44,6 +45,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -241,7 +246,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -302,7 +307,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -466,7 +471,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -535,7 +540,7 @@ async def get(self, resource_group_name: str, disk_access_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -583,7 +588,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -640,7 +645,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -693,7 +698,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -774,7 +779,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -869,7 +874,7 @@ async def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -922,7 +927,7 @@ async def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1104,7 +1109,7 @@ async def begin_update_a_private_endpoint_connection( _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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1178,7 +1183,7 @@ async def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1227,7 +1232,7 @@ async def _delete_a_private_endpoint_connection_initial( # 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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1287,7 +1292,7 @@ async def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1348,7 +1353,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_encryption_sets_operations.py index e8877828b96c..b2b7fb425dfc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -248,7 +253,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -309,7 +314,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -476,7 +481,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -595,7 +600,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,7 +712,7 @@ 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", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -788,7 +793,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -875,7 +880,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_restore_point_operations.py index 5d8e68b20f10..159f4416dd77 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,10 @@ build_revoke_access_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -156,7 +161,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -246,7 +251,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -428,7 +433,7 @@ async def begin_grant_access( _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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -494,7 +499,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -562,7 +567,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disks_operations.py index 686f37b01a78..b29aeba7945c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -233,7 +238,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -290,7 +295,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -445,7 +450,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -514,7 +519,7 @@ async def get(self, resource_group_name: str, disk_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", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ async def begin_delete(self, resource_group_name: str, disk_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -669,7 +674,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -749,7 +754,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -834,7 +839,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -996,7 +1001,7 @@ async def begin_grant_access( _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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1055,7 +1060,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1112,7 +1117,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_snapshots_operations.py index 1d4fafd97b08..ca91de9dd760 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/aio/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -236,7 +241,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +298,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -453,7 +458,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +527,7 @@ async def get(self, resource_group_name: str, snapshot_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", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -570,7 +575,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete(self, resource_group_name: str, snapshot_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -759,7 +764,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -844,7 +849,7 @@ async def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1006,7 +1011,7 @@ async def begin_grant_access( _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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -1065,7 +1070,7 @@ async def _revoke_access_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1122,7 +1127,7 @@ async def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/__init__.py index a961d211432f..697f5170bed6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/__init__.py @@ -56,6 +56,7 @@ from ._models_py3 import SubResource from ._models_py3 import SubResourceReadOnly from ._models_py3 import SupportedCapabilities +from ._models_py3 import SystemData from ._models_py3 import UserAssignedIdentitiesValue from ._compute_management_client_enums import AccessLevel @@ -132,6 +133,7 @@ "SubResource", "SubResourceReadOnly", "SupportedCapabilities", + "SystemData", "UserAssignedIdentitiesValue", "AccessLevel", "Architecture", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_models_py3.py index f423c09c8cb4..c48b64df8ce7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/models/_models_py3.py @@ -3089,6 +3089,36 @@ def __init__( self.architecture = architecture +class SystemData(_serialization.Model): + """The system meta data relating to this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: Specifies the time in UTC at which the Cloud Service (extended support) + resource was created. :code:`
`Minimum api-version: 2022-04-04. + :vartype created_at: ~datetime.datetime + :ivar last_modified_at: Specifies the time in UTC at which the Cloud Service (extended support) + resource was last modified. :code:`
`Minimum api-version: 2022-04-04. + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + "created_at": {"readonly": True}, + "last_modified_at": {"readonly": True}, + } + + _attribute_map = { + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.created_at = None + self.last_modified_at = None + + class UserAssignedIdentitiesValue(_serialization.Model): """UserAssignedIdentitiesValue. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_accesses_operations.py index 93840703f28f..fd4fbebb5277 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_accesses_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_accesses_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_get_private_link_resources_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +266,7 @@ def build_update_a_private_endpoint_connection_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -302,7 +307,7 @@ def build_get_a_private_endpoint_connection_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ def build_delete_a_private_endpoint_connection_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -374,7 +379,7 @@ def build_list_private_endpoint_connections_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +437,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -589,7 +594,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -650,7 +655,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] @@ -811,7 +816,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -880,7 +885,7 @@ def get(self, resource_group_name: str, disk_access_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", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccess] request = build_get_request( @@ -928,7 +933,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -983,7 +988,7 @@ def begin_delete(self, resource_group_name: str, disk_access_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1035,7 +1040,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1115,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskAccess"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskAccessList] error_map = { @@ -1210,7 +1215,7 @@ def get_private_link_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] request = build_get_private_link_resources_request( @@ -1263,7 +1268,7 @@ def _update_a_private_endpoint_connection_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] @@ -1445,7 +1450,7 @@ def begin_update_a_private_endpoint_connection( _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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1519,7 +1524,7 @@ def get_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] request = build_get_a_private_endpoint_connection_request( @@ -1568,7 +1573,7 @@ def _delete_a_private_endpoint_connection_initial( # 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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_a_private_endpoint_connection_request( @@ -1628,7 +1633,7 @@ def begin_delete_a_private_endpoint_connection( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1689,7 +1694,7 @@ def list_private_endpoint_connections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_encryption_sets_operations.py index 02f4b9787ce5..3caf0c9fd2d9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_encryption_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_encryption_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,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", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,7 @@ def build_list_associated_resources_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,7 +293,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -452,7 +457,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -513,7 +518,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] @@ -677,7 +682,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -746,7 +751,7 @@ def get(self, resource_group_name: str, disk_encryption_set_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSet] request = build_get_request( @@ -794,7 +799,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -849,7 +854,7 @@ def begin_delete(self, resource_group_name: str, disk_encryption_set_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -901,7 +906,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiskEncryptionSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskEncryptionSetList] error_map = { @@ -1068,7 +1073,7 @@ def list_associated_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceUriList] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_restore_point_operations.py index 7d2f468795bf..587581403cc1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_restore_point_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disk_restore_point_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def build_list_by_restore_point_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,7 @@ def build_grant_access_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -170,7 +175,7 @@ def build_revoke_access_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +260,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePoint] request = build_get_request( @@ -313,7 +318,7 @@ def list_by_restore_point( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskRestorePointList] error_map = { @@ -403,7 +408,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -582,7 +587,7 @@ def begin_grant_access( _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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -648,7 +653,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -716,7 +721,7 @@ def begin_revoke_access( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disks_operations.py index 0294f7f3b69e..d38011e24034 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disks_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_disks_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, disk_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_get_request(resource_group_name: str, disk_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", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +141,7 @@ def build_get_request(resource_group_name: str, disk_name: str, subscription_id: def build_delete_request(resource_group_name: str, disk_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -160,7 +165,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +193,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,7 @@ def build_grant_access_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -247,7 +252,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -300,7 +305,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -455,7 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -512,7 +517,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] @@ -667,7 +672,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -736,7 +741,7 @@ def get(self, resource_group_name: str, disk_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", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Disk] request = build_get_request( @@ -784,7 +789,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -839,7 +844,7 @@ def begin_delete(self, resource_group_name: str, disk_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", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -891,7 +896,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -971,7 +976,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Disk"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiskList] error_map = { @@ -1056,7 +1061,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1215,7 +1220,7 @@ def begin_grant_access( _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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1274,7 +1279,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1329,7 +1334,7 @@ def begin_revoke_access(self, resource_group_name: str, disk_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_snapshots_operations.py index cc628936532b..086917032173 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_snapshots_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_07_02/operations/_snapshots_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,7 @@ def build_get_request(resource_group_name: str, snapshot_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +145,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +169,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +197,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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -218,7 +223,7 @@ def build_grant_access_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -251,7 +256,7 @@ def build_revoke_access_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +309,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -459,7 +464,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -516,7 +521,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] @@ -673,7 +678,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -742,7 +747,7 @@ def get(self, resource_group_name: str, snapshot_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", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] request = build_get_request( @@ -790,7 +795,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -845,7 +850,7 @@ def begin_delete(self, resource_group_name: str, snapshot_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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -897,7 +902,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -977,7 +982,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotList] error_map = { @@ -1062,7 +1067,7 @@ def _grant_access_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AccessUri]] @@ -1221,7 +1226,7 @@ def begin_grant_access( _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-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AccessUri] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1280,7 +1285,7 @@ def _revoke_access_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_revoke_access_request( @@ -1335,7 +1340,7 @@ def begin_revoke_access(self, resource_group_name: str, snapshot_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02")) # type: Literal["2022-07-02"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/__init__.py index 835f3211b3cd..59055ae8a3e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_configuration.py index b328d1d686f8..a615a75336e6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-08-01") # type: str + api_version = kwargs.pop("api_version", "2022-08-01") # type: Literal["2022-08-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_metadata.json index 78f9a2803847..b742cf0e3fa6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_metadata.json @@ -124,4 +124,4 @@ "virtual_machine_run_commands": "VirtualMachineRunCommandsOperations", "virtual_machine_scale_set_vm_run_commands": "VirtualMachineScaleSetVMRunCommandsOperations" } -} \ No newline at end of file +} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py index a1b6f8ec6763..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "29.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/__init__.py index 2351b55ffa1d..948b2984b33c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ComputeManagementClient"] +__all__ = [ + "ComputeManagementClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/_configuration.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/_configuration.py index 470eb1972c53..6cb390662d65 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/_configuration.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -37,7 +43,7 @@ class ComputeManagementClientConfiguration(Configuration): # pylint: disable=to def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ComputeManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-08-01") # type: str + api_version = kwargs.pop("api_version", "2022-08-01") # type: Literal["2022-08-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_availability_sets_operations.py index 14bbde7471a4..4ca6cd3d18d5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -287,7 +292,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -359,7 +364,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -413,7 +418,7 @@ async def get(self, resource_group_name: str, availability_set_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -465,7 +470,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -548,7 +553,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -636,7 +641,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservation_groups_operations.py index 403be17f8998..5c1e5ba4f53c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -301,7 +306,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -376,7 +381,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -443,7 +448,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -506,7 +511,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -598,7 +603,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservations_operations.py index ca4a6704c80b..10d00fd6022b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -255,7 +260,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -318,7 +323,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -485,7 +490,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -547,7 +552,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -611,7 +616,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -688,7 +693,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -744,7 +749,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_host_groups_operations.py index 6ecd9c765a9f..c12fb4349d04 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -156,7 +161,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -296,7 +301,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -368,7 +373,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -433,7 +438,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -486,7 +491,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -568,7 +573,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Dedicate _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_hosts_operations.py index 567b30981774..0e5621a42948 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -250,7 +255,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -313,7 +318,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -478,7 +483,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -536,7 +541,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -594,7 +599,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -670,7 +675,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -726,7 +731,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { @@ -809,7 +814,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -870,7 +875,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_images_operations.py index 49ea180e2f77..30c56fcac647 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -225,7 +230,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -282,7 +287,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -431,7 +436,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -488,7 +493,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -541,7 +546,7 @@ async def begin_delete(self, resource_group_name: str, image_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -607,7 +612,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -656,7 +661,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -737,7 +742,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_log_analytics_operations.py index faa8817d6d81..94d077e868cc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_export_throttled_requests_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]] @@ -69,7 +74,7 @@ async def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -213,7 +218,7 @@ async def begin_export_request_rate_by_interval( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -272,7 +277,7 @@ async def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -414,7 +419,7 @@ async def begin_export_throttled_requests( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_operations.py index 5b01d32359d4..1bccd7af7ded 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_proximity_placement_groups_operations.py index ab37a4ab0701..9758575a0c41 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,6 +38,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -152,7 +157,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -294,7 +299,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -366,7 +371,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -429,7 +434,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -478,7 +483,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Proximit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -563,7 +568,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_point_collections_operations.py index 6c0c069cb78f..9d3f0caf843e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -160,7 +165,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -302,7 +307,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -362,7 +367,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -418,7 +423,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -490,7 +495,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -541,7 +546,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -625,7 +630,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.RestorePointCollecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_points_operations.py index 1ffec2c1d4e6..b0401d1377c5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._restore_points_operations import build_create_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]] @@ -71,7 +76,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -236,7 +241,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -294,7 +299,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -352,7 +357,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -427,7 +432,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_ssh_public_keys_operations.py index b34528008484..2f9570719b58 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SshPubli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -162,7 +167,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -320,7 +325,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -460,7 +465,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -532,7 +537,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -588,7 +593,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -650,7 +655,7 @@ async def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_usage_operations.py index 99aef157b02b..19d0f91f870c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._usage_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]] @@ -67,7 +72,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extension_images_operations.py index fe4ba2da1421..a27be856e936 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -31,6 +32,10 @@ build_list_versions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -146,7 +151,7 @@ async def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -221,7 +226,7 @@ async def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extensions_operations.py index c079d4a51082..ad005b700b1f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -252,7 +257,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +320,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -487,7 +492,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -545,7 +550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -604,7 +609,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -678,7 +683,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_edge_zone_operations.py index 43fa8b713a39..2bff7638a2b6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -33,6 +34,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -178,7 +183,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -247,7 +252,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -308,7 +313,7 @@ async def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -373,7 +378,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_operations.py index 63ce4773cd83..5b6328e9adaf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_list_skus_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -171,7 +176,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -236,7 +241,7 @@ async def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -292,7 +297,7 @@ async def list_publishers(self, location: str, **kwargs: Any) -> List[_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -353,7 +358,7 @@ async def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( @@ -414,7 +419,7 @@ async def list_by_edge_zone( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VmImagesInEdgeZoneListResult] request = build_list_by_edge_zone_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_run_commands_operations.py index 42d73f137885..8dfde75d2e59 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.RunComman _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -171,7 +176,7 @@ async def get(self, location: str, command_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -224,7 +229,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -398,7 +403,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -461,7 +466,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -631,7 +636,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -689,7 +694,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -748,7 +753,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -817,7 +822,7 @@ async def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -875,7 +880,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py index 5c72bdcabfc7..c6864e8ade6e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -256,7 +261,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +324,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -495,7 +500,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -553,7 +558,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -686,7 +691,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -742,7 +747,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index 7f87b5e8b2ec..d5cfb175b46b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -34,6 +35,10 @@ build_start_os_upgrade_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +76,7 @@ async def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -126,7 +131,7 @@ async def begin_cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -178,7 +183,7 @@ async def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -235,7 +240,7 @@ async def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -287,7 +292,7 @@ async def _start_extension_upgrade_initial( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -344,7 +349,7 @@ async def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -408,7 +413,7 @@ async def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py index c292a0437949..349ebaf24761 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -261,7 +266,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -326,7 +331,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -505,7 +510,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -564,7 +569,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -703,7 +708,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -775,7 +780,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 51d889bafc02..2fbe8e644ce6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,6 +39,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -262,7 +267,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -327,7 +332,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -504,7 +509,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -563,7 +568,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -702,7 +707,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -768,7 +773,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vms_operations.py index 57f708f33d68..d7c3d4146b44 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -49,6 +50,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,7 +96,7 @@ async def _reimage_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -253,7 +258,7 @@ async def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -309,7 +314,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -368,7 +373,7 @@ async def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -421,7 +426,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -481,7 +486,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -539,7 +544,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -713,7 +718,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -776,7 +781,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -843,7 +848,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -920,7 +925,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -984,7 +989,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1055,7 +1060,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1146,7 +1151,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1216,7 +1221,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1275,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1328,7 +1333,7 @@ async def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1381,7 +1386,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1439,7 +1444,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1492,7 +1497,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -1551,7 +1556,7 @@ async def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1628,7 +1633,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -1678,7 +1683,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -1736,7 +1741,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1803,7 +1808,7 @@ async def simulate_eviction( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -1853,7 +1858,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2020,7 +2025,7 @@ async def begin_run_command( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_sets_operations.py index 069b7ff72062..7d3f979acbc5 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -56,6 +57,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -182,7 +187,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -340,7 +345,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -401,7 +406,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -555,7 +560,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -612,7 +617,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -671,7 +676,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,7 +749,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -797,7 +802,7 @@ async def _deallocate_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -955,7 +960,7 @@ async def begin_deallocate( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -1015,7 +1020,7 @@ async def _delete_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1177,7 +1182,7 @@ async def begin_delete_instances( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -1245,7 +1250,7 @@ async def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -1295,7 +1300,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -1379,7 +1384,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineScaleS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -1467,7 +1472,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -1556,7 +1561,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -1644,7 +1649,7 @@ async def _power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1818,7 +1823,7 @@ async def begin_power_off( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -1878,7 +1883,7 @@ async def _restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2030,7 +2035,7 @@ async def begin_restart( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -2089,7 +2094,7 @@ async def _start_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2241,7 +2246,7 @@ async def begin_start( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -2300,7 +2305,7 @@ async def _redeploy_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2455,7 +2460,7 @@ async def begin_redeploy( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -2514,7 +2519,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2675,7 +2680,7 @@ async def begin_perform_maintenance( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -2734,7 +2739,7 @@ async def _update_instances_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2883,7 +2888,7 @@ async def begin_update_instances( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -2942,7 +2947,7 @@ async def _reimage_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3098,7 +3103,7 @@ async def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -3157,7 +3162,7 @@ async def _reimage_all_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3312,7 +3317,7 @@ async def begin_reimage_all( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -3395,7 +3400,7 @@ async def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -3527,7 +3532,7 @@ async def convert_to_single_placement_group( # pylint: disable=inconsistent-ret _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3587,7 +3592,7 @@ async def _set_orchestration_service_state_initial( # pylint: disable=inconsist _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3735,7 +3740,7 @@ async def begin_set_orchestration_service_state( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_sizes_operations.py index 2aa46c7ff70c..457f470ffb47 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._virtual_machine_sizes_operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machines_operations.py index 1393f203deba..0a1745e3d0bf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/aio/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -58,6 +59,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -183,7 +188,7 @@ async def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -343,7 +348,7 @@ async def begin_capture( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -402,7 +407,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -560,7 +565,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -617,7 +622,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -768,7 +773,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -825,7 +830,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -884,7 +889,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -959,7 +964,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1020,7 +1025,7 @@ async def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1068,7 +1073,7 @@ async def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1124,7 +1129,7 @@ async def begin_convert_to_managed_disks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1176,7 +1181,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1236,7 +1241,7 @@ async def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1306,7 +1311,7 @@ async def generalize( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -1359,7 +1364,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1452,7 +1457,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -1541,7 +1546,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -1624,7 +1629,7 @@ async def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1685,7 +1690,7 @@ async def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1738,7 +1743,7 @@ async def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -1791,7 +1796,7 @@ async def begin_reapply(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1843,7 +1848,7 @@ async def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1896,7 +1901,7 @@ async def begin_restart(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1948,7 +1953,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2001,7 +2006,7 @@ async def begin_start(self, resource_group_name: str, vm_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2053,7 +2058,7 @@ async def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2106,7 +2111,7 @@ async def begin_redeploy(self, resource_group_name: str, vm_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2162,7 +2167,7 @@ async def _reimage_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2312,7 +2317,7 @@ async def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -2387,7 +2392,7 @@ async def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2436,7 +2441,7 @@ async def _perform_maintenance_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2491,7 +2496,7 @@ async def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2555,7 +2560,7 @@ async def simulate_eviction( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2599,7 +2604,7 @@ async def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -2662,7 +2667,7 @@ async def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2722,7 +2727,7 @@ async def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -2883,7 +2888,7 @@ async def begin_install_patches( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -2942,7 +2947,7 @@ async def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3095,7 +3100,7 @@ async def begin_run_command( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/__init__.py index d0752a0fd7d2..627b60b04342 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/__init__.py @@ -142,6 +142,7 @@ from ._models_py3 import SubResource from ._models_py3 import SubResourceReadOnly from ._models_py3 import SubResourceWithColocationStatus +from ._models_py3 import SystemData from ._models_py3 import TerminateNotificationProfile from ._models_py3 import ThrottledRequestsInput from ._models_py3 import UefiSettings @@ -468,6 +469,7 @@ "SubResource", "SubResourceReadOnly", "SubResourceWithColocationStatus", + "SystemData", "TerminateNotificationProfile", "ThrottledRequestsInput", "UefiSettings", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/_models_py3.py index 280158b7aa78..5983b5529839 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/models/_models_py3.py @@ -13,13 +13,18 @@ from ... import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -87,8 +92,8 @@ class AdditionalUnattendContent(_serialization.Model): def __init__( self, *, - pass_name: Optional[str] = None, - component_name: Optional[str] = None, + pass_name: Optional[Literal["OobeSystem"]] = None, + component_name: Optional[Literal["Microsoft-Windows-Shell-Setup"]] = None, setting_name: Optional[Union[str, "_models.SettingNames"]] = None, content: Optional[str] = None, **kwargs @@ -7201,6 +7206,36 @@ def __init__( self.colocation_status = colocation_status +class SystemData(_serialization.Model): + """The system meta data relating to this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: Specifies the time in UTC at which the Cloud Service (extended support) + resource was created. :code:`
`Minimum api-version: 2022-04-04. + :vartype created_at: ~datetime.datetime + :ivar last_modified_at: Specifies the time in UTC at which the Cloud Service (extended support) + resource was last modified. :code:`
`Minimum api-version: 2022-04-04. + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + "created_at": {"readonly": True}, + "last_modified_at": {"readonly": True}, + } + + _attribute_map = { + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.created_at = None + self.last_modified_at = None + + class TerminateNotificationProfile(_serialization.Model): """TerminateNotificationProfile. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_availability_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_availability_sets_operations.py index fe1860bb4ebc..069e02afffef 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_availability_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_availability_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +146,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +177,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -228,7 +233,7 @@ def build_list_available_sizes_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -362,7 +367,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -498,7 +503,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] @@ -570,7 +575,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -624,7 +629,7 @@ def get(self, resource_group_name: str, availability_set_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySet] request = build_get_request( @@ -673,7 +678,7 @@ def list_by_subscription(self, expand: Optional[str] = None, **kwargs: Any) -> 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -755,7 +760,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Ava _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailabilitySetListResult] error_map = { @@ -842,7 +847,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservation_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservation_groups_operations.py index 3ef1956e1003..430423038cbc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservation_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservation_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +231,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -365,7 +370,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -510,7 +515,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] @@ -585,7 +590,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -652,7 +657,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroup] request = build_get_request( @@ -715,7 +720,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { @@ -807,7 +812,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservations_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservations_operations.py index 1b6b2aba530a..f67de7bb0ff6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservations_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_capacity_reservations_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +53,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -89,7 +94,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -130,7 +135,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +211,7 @@ def build_list_by_capacity_reservation_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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +276,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] @@ -446,7 +451,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -509,7 +514,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CapacityReservation]] @@ -676,7 +681,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -738,7 +743,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -802,7 +807,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -879,7 +884,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservation] request = build_get_request( @@ -935,7 +940,7 @@ def list_by_capacity_reservation_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CapacityReservationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_host_groups_operations.py index 3ba9399a03f3..ddba89d69be8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_host_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_host_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -110,7 +115,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +151,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +182,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +210,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -340,7 +345,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -480,7 +485,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] @@ -552,7 +557,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -617,7 +622,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroup] request = build_get_request( @@ -667,7 +672,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { @@ -748,7 +753,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DedicatedHost _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_hosts_operations.py index 4dd6eb708a8a..c7b84d0ffc8a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_dedicated_hosts_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,7 @@ def build_list_by_host_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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +222,7 @@ def build_restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +286,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -447,7 +452,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -510,7 +515,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] @@ -672,7 +677,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -730,7 +735,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -788,7 +793,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -864,7 +869,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHost] request = build_get_request( @@ -919,7 +924,7 @@ def list_by_host_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DedicatedHostListResult] error_map = { @@ -1002,7 +1007,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1063,7 +1068,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_images_operations.py index 60749486a4a6..8b29920ef548 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -76,7 +81,7 @@ def build_update_request(resource_group_name: str, image_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -108,7 +113,7 @@ def build_delete_request(resource_group_name: str, image_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +144,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +175,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -400,7 +405,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -457,7 +462,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] @@ -606,7 +611,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -663,7 +668,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -716,7 +721,7 @@ def begin_delete(self, resource_group_name: str, image_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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -782,7 +787,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] request = build_get_request( @@ -831,7 +836,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { @@ -912,7 +917,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Image"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_log_analytics_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_log_analytics_operations.py index 3b37847f5742..90a81102be98 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_log_analytics_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_log_analytics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_export_request_rate_by_interval_request(location: 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -71,7 +76,7 @@ def build_export_throttled_requests_request(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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -131,7 +136,7 @@ def _export_request_rate_by_interval_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -275,7 +280,7 @@ def begin_export_request_rate_by_interval( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -333,7 +338,7 @@ def _export_throttled_requests_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogAnalyticsOperationResult]] @@ -475,7 +480,7 @@ def begin_export_throttled_requests( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.LogAnalyticsOperationResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_operations.py index a305f8e248bb..5db44897dcf4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ComputeOperationValue"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ComputeOperationListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_proximity_placement_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_proximity_placement_groups_operations.py index 6085bfeaab8e..548dcab74077 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_proximity_placement_groups_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_proximity_placement_groups_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -78,7 +83,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -490,7 +495,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] @@ -562,7 +567,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -625,7 +630,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroup] request = build_get_request( @@ -674,7 +679,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ProximityPlac _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { @@ -759,7 +764,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ProximityPlacementGroupListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_point_collections_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_point_collections_operations.py index ec868bb10a4a..ae255654ac21 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_point_collections_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_point_collections_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -80,7 +85,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -116,7 +121,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +159,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +192,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +220,7 @@ def build_list_all_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +359,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -496,7 +501,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] @@ -556,7 +561,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -612,7 +617,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,7 +689,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollection] request = build_get_request( @@ -735,7 +740,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Res _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { @@ -819,7 +824,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.RestorePointCollection"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointCollectionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_points_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_points_operations.py index ad5f6f0756e9..a840ca3cbdeb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_points_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_restore_points_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +51,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -87,7 +92,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +132,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +200,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] @@ -360,7 +365,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -418,7 +423,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -476,7 +481,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -551,7 +556,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] request = build_get_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_ssh_public_keys_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_ssh_public_keys_operations.py index 51944122dc23..94fd665d236b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_ssh_public_keys_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_ssh_public_keys_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +69,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +99,7 @@ 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -128,7 +133,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -162,7 +167,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,7 @@ def build_generate_key_pair_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -283,7 +288,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SshPublicKeyR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -369,7 +374,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeysGroupListResult] error_map = { @@ -527,7 +532,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -667,7 +672,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] @@ -739,7 +744,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -793,7 +798,7 @@ def get(self, resource_group_name: str, ssh_public_key_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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyResource] request = build_get_request( @@ -855,7 +860,7 @@ def generate_key_pair( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SshPublicKeyGenerateKeyPairResult] request = build_generate_key_pair_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_usage_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_usage_operations.py index 19d6874b7ed0..cfb29b6130e7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_usage_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_usage_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extension_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extension_images_operations.py index 8d7c89b03ae2..08f8324aaee7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extension_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extension_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +76,7 @@ def build_list_types_request(location: str, publisher_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +115,7 @@ def build_list_versions_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +196,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionImage] request = build_get_request( @@ -253,7 +258,7 @@ def list_types( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_types_request( @@ -328,7 +333,7 @@ def list_versions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineExtensionImage]] request = build_list_versions_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extensions_operations.py index 611a17eb82e9..05aaaae223c1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -77,7 +82,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -112,7 +117,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +189,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -424,7 +429,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -487,7 +492,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] @@ -659,7 +664,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -717,7 +722,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -776,7 +781,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -850,7 +855,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtension] request = build_get_request( @@ -914,7 +919,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_edge_zone_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_edge_zone_operations.py index 0f22d35b450c..6a78475a8272 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_edge_zone_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_edge_zone_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +97,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +137,7 @@ def build_list_offers_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +167,7 @@ def build_list_publishers_request(location: str, edge_zone: 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def build_list_skus_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -273,7 +278,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -361,7 +366,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -430,7 +435,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -491,7 +496,7 @@ def list_publishers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -556,7 +561,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_operations.py index aca4986592f3..7d90c8b51119 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_images_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ 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]] @@ -40,7 +45,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +88,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +125,7 @@ def build_list_offers_request(location: str, publisher_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_list_publishers_request(location: 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,7 +183,7 @@ def build_list_skus_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,7 +213,7 @@ def build_list_by_edge_zone_request(location: str, edge_zone: 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +289,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineImage] request = build_get_request( @@ -366,7 +371,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_request( @@ -431,7 +436,7 @@ def list_offers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_offers_request( @@ -487,7 +492,7 @@ def list_publishers(self, location: str, **kwargs: Any) -> List[_models.VirtualM _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_publishers_request( @@ -548,7 +553,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[List[_models.VirtualMachineImageResource]] request = build_list_skus_request( @@ -607,7 +612,7 @@ def list_by_edge_zone(self, location: str, edge_zone: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VmImagesInEdgeZoneListResult] request = build_list_by_edge_zone_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_run_commands_operations.py index c58093120e46..3fc0bfbceb7d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -69,7 +74,7 @@ def build_get_request(location: str, command_id: 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -100,7 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -135,7 +140,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -170,7 +175,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -208,7 +213,7 @@ def build_get_by_virtual_machine_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -242,7 +247,7 @@ def build_list_by_virtual_machine_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -304,7 +309,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.RunCommandDocu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandListResult] error_map = { @@ -396,7 +401,7 @@ def get(self, location: str, command_id: str, **kwargs: Any) -> _models.RunComma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandDocument] request = build_get_request( @@ -449,7 +454,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -623,7 +628,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -686,7 +691,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -856,7 +861,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -914,7 +919,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -973,7 +978,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1042,7 +1047,7 @@ def get_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_by_virtual_machine_request( @@ -1100,7 +1105,7 @@ def list_by_virtual_machine( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_extensions_operations.py index 33fe9023cf7d..51a94688a995 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -114,7 +119,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +157,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +191,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,7 +254,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -425,7 +430,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -488,7 +493,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] @@ -664,7 +669,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -722,7 +727,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -781,7 +786,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -855,7 +860,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtension] request = build_get_request( @@ -911,7 +916,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetExtensionListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py index b91f72cea96d..2cf71de5649a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_rolling_upgrades_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_cancel_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_start_os_upgrade_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,7 @@ def build_start_extension_upgrade_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +140,7 @@ def build_get_latest_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +198,7 @@ def _cancel_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_cancel_request( @@ -246,7 +251,7 @@ def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -298,7 +303,7 @@ def _start_os_upgrade_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_os_upgrade_request( @@ -355,7 +360,7 @@ def begin_start_os_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -407,7 +412,7 @@ def _start_extension_upgrade_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_extension_upgrade_request( @@ -464,7 +469,7 @@ def begin_start_extension_upgrade( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -528,7 +533,7 @@ def get_latest( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RollingUpgradeStatusInfo] request = build_get_latest_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py index 894d7daaea11..a8c3a85a202e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_extensions_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -88,7 +93,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -129,7 +134,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +174,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +215,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] @@ -704,7 +709,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -763,7 +768,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -824,7 +829,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -902,7 +907,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtension] request = build_get_request( @@ -974,7 +979,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMExtensionsListResult] request = build_list_request( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py index 501337d86bf5..55c7662f5297 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vm_run_commands_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +54,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -90,7 +95,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -131,7 +136,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -171,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -212,7 +217,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json, text/json") # Construct URL @@ -279,7 +284,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -460,7 +465,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -525,7 +530,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] @@ -702,7 +707,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -761,7 +766,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -822,7 +827,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -900,7 +905,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommand] request = build_get_request( @@ -966,7 +971,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineRunCommandsListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vms_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vms_operations.py index 85a26b779817..ea33deaeb26c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vms_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_set_vms_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_reimage_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -79,7 +84,7 @@ def build_reimage_all_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_deallocate_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +148,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -184,7 +189,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +229,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +263,7 @@ def build_get_instance_view_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +302,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +347,7 @@ def build_power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +413,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -440,7 +445,7 @@ def build_redeploy_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -478,7 +483,7 @@ def build_retrieve_boot_diagnostics_data_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -514,7 +519,7 @@ def build_perform_maintenance_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +551,7 @@ def build_simulate_eviction_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -578,7 +583,7 @@ def build_run_command_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -645,7 +650,7 @@ def _reimage_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -807,7 +812,7 @@ def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -863,7 +868,7 @@ def _reimage_all_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reimage_all_request( @@ -922,7 +927,7 @@ def begin_reimage_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -975,7 +980,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -1035,7 +1040,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1093,7 +1098,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] @@ -1267,7 +1272,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1330,7 +1335,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1397,7 +1402,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1479,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVM] request = build_get_request( @@ -1538,7 +1543,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMInstanceView] request = build_get_instance_view_request( @@ -1609,7 +1614,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetVMListResult] error_map = { @@ -1700,7 +1705,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -1770,7 +1775,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1824,7 +1829,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -1882,7 +1887,7 @@ def begin_restart( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1935,7 +1940,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -1993,7 +1998,7 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2046,7 +2051,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2105,7 +2110,7 @@ def begin_redeploy( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2182,7 +2187,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -2232,7 +2237,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -2290,7 +2295,7 @@ def begin_perform_maintenance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2357,7 +2362,7 @@ def simulate_eviction( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -2407,7 +2412,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -2571,7 +2576,7 @@ def begin_run_command( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_sets_operations.py index 5f92975106cf..22e43fd19a52 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_sets_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_scale_sets_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +77,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -106,7 +111,7 @@ 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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -145,7 +150,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +188,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,7 @@ def build_deallocate_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -255,7 +260,7 @@ def build_delete_instances_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -291,7 +296,7 @@ def build_get_instance_view_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -320,7 +325,7 @@ def build_list_request(resource_group_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -348,7 +353,7 @@ def build_list_all_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -376,7 +381,7 @@ def build_list_skus_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -407,7 +412,7 @@ def build_get_os_upgrade_history_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -443,7 +448,7 @@ def build_power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -479,7 +484,7 @@ def build_restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -513,7 +518,7 @@ def build_start_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -547,7 +552,7 @@ def build_redeploy_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -581,7 +586,7 @@ def build_perform_maintenance_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -615,7 +620,7 @@ def build_update_instances_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -649,7 +654,7 @@ def build_reimage_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -683,7 +688,7 @@ def build_reimage_all_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -724,7 +729,7 @@ def build_force_recovery_service_fabric_platform_update_domain_walk_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -760,7 +765,7 @@ def build_convert_to_single_placement_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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -794,7 +799,7 @@ def build_set_orchestration_service_state_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -858,7 +863,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -944,7 +949,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1102,7 +1107,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1163,7 +1168,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] @@ -1317,7 +1322,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1374,7 +1379,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1433,7 +1438,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1506,7 +1511,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSet] request = build_get_request( @@ -1559,7 +1564,7 @@ def _deallocate_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1717,7 +1722,7 @@ def begin_deallocate( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -1777,7 +1782,7 @@ def _delete_instances_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1939,7 +1944,7 @@ def begin_delete_instances( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -2007,7 +2012,7 @@ def get_instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetInstanceView] request = build_get_instance_view_request( @@ -2057,7 +2062,7 @@ def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Vir _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListResult] error_map = { @@ -2141,7 +2146,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.VirtualMachineScaleSet"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListWithLinkResult] error_map = { @@ -2229,7 +2234,7 @@ def list_skus( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListSkusResult] error_map = { @@ -2318,7 +2323,7 @@ def get_os_upgrade_history( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineScaleSetListOSUpgradeHistory] error_map = { @@ -2406,7 +2411,7 @@ def _power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2580,7 +2585,7 @@ def begin_power_off( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -2640,7 +2645,7 @@ def _restart_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -2792,7 +2797,7 @@ def begin_restart( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -2851,7 +2856,7 @@ def _start_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3003,7 +3008,7 @@ def begin_start( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -3062,7 +3067,7 @@ def _redeploy_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3217,7 +3222,7 @@ def begin_redeploy( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -3276,7 +3281,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3437,7 +3442,7 @@ def begin_perform_maintenance( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -3496,7 +3501,7 @@ def _update_instances_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3645,7 +3650,7 @@ def begin_update_instances( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -3704,7 +3709,7 @@ def _reimage_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3860,7 +3865,7 @@ def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -3919,7 +3924,7 @@ def _reimage_all_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4074,7 +4079,7 @@ def begin_reimage_all( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -4157,7 +4162,7 @@ def force_recovery_service_fabric_platform_update_domain_walk( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoveryWalkResponse] request = build_force_recovery_service_fabric_platform_update_domain_walk_request( @@ -4289,7 +4294,7 @@ def convert_to_single_placement_group( # pylint: disable=inconsistent-return-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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4349,7 +4354,7 @@ def _set_orchestration_service_state_initial( # pylint: disable=inconsistent-re _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -4497,7 +4502,7 @@ def begin_set_orchestration_service_state( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_sizes_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_sizes_operations.py index 7df2f0577374..7677f84c8d8b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_sizes_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machine_sizes_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -29,6 +30,10 @@ 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]] @@ -40,7 +45,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +102,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.VirtualMachine _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machines_operations.py index 368a4f3b3f72..502c202b8b89 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2022_08_01/operations/_virtual_machines_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -31,6 +32,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_location_request(location: 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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +75,7 @@ def build_capture_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -104,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -136,7 +141,7 @@ def build_update_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -175,7 +180,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,7 +218,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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +251,7 @@ def build_instance_view_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +282,7 @@ def build_convert_to_managed_disks_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -308,7 +313,7 @@ def build_deallocate_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -341,7 +346,7 @@ def build_generalize_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -372,7 +377,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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -404,7 +409,7 @@ def build_list_all_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -434,7 +439,7 @@ def build_list_available_sizes_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -465,7 +470,7 @@ def build_power_off_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -496,7 +501,7 @@ def build_reapply_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -525,7 +530,7 @@ def build_restart_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -554,7 +559,7 @@ def build_start_request(resource_group_name: str, vm_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", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -583,7 +588,7 @@ def build_redeploy_request(resource_group_name: str, vm_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -612,7 +617,7 @@ def build_reimage_request(resource_group_name: str, vm_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -651,7 +656,7 @@ def build_retrieve_boot_diagnostics_data_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -686,7 +691,7 @@ def build_perform_maintenance_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -717,7 +722,7 @@ def build_simulate_eviction_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -748,7 +753,7 @@ def build_assess_patches_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -779,7 +784,7 @@ def build_install_patches_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -813,7 +818,7 @@ def build_run_command_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json, text/json") @@ -875,7 +880,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Vi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -961,7 +966,7 @@ def _capture_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineCaptureResult]] @@ -1121,7 +1126,7 @@ def begin_capture( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineCaptureResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1180,7 +1185,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1335,7 +1340,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1392,7 +1397,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] @@ -1540,7 +1545,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1597,7 +1602,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -1656,7 +1661,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1731,7 +1736,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachine] request = build_get_request( @@ -1792,7 +1797,7 @@ def instance_view( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstanceView] request = build_instance_view_request( @@ -1840,7 +1845,7 @@ def _convert_to_managed_disks_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_convert_to_managed_disks_request( @@ -1894,7 +1899,7 @@ def begin_convert_to_managed_disks(self, resource_group_name: str, vm_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1946,7 +1951,7 @@ def _deallocate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deallocate_request( @@ -2006,7 +2011,7 @@ def begin_deallocate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2076,7 +2081,7 @@ def generalize( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_generalize_request( @@ -2128,7 +2133,7 @@ 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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2220,7 +2225,7 @@ def list_all( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineListResult] error_map = { @@ -2308,7 +2313,7 @@ def list_available_sizes( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineSizeListResult] error_map = { @@ -2391,7 +2396,7 @@ def _power_off_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_power_off_request( @@ -2452,7 +2457,7 @@ def begin_power_off( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2505,7 +2510,7 @@ def _reapply_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_reapply_request( @@ -2558,7 +2563,7 @@ def begin_reapply(self, resource_group_name: str, vm_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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2610,7 +2615,7 @@ def _restart_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_request( @@ -2663,7 +2668,7 @@ def begin_restart(self, resource_group_name: str, vm_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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2715,7 +2720,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_start_request( @@ -2768,7 +2773,7 @@ def begin_start(self, resource_group_name: str, vm_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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2820,7 +2825,7 @@ def _redeploy_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_redeploy_request( @@ -2873,7 +2878,7 @@ def begin_redeploy(self, resource_group_name: str, vm_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", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2929,7 +2934,7 @@ def _reimage_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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -3079,7 +3084,7 @@ def begin_reimage( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-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] @@ -3154,7 +3159,7 @@ def retrieve_boot_diagnostics_data( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RetrieveBootDiagnosticsDataResult] request = build_retrieve_boot_diagnostics_data_request( @@ -3203,7 +3208,7 @@ def _perform_maintenance_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_perform_maintenance_request( @@ -3256,7 +3261,7 @@ def begin_perform_maintenance(self, resource_group_name: str, vm_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3320,7 +3325,7 @@ def simulate_eviction( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_simulate_eviction_request( @@ -3364,7 +3369,7 @@ def _assess_patches_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineAssessPatchesResult]] request = build_assess_patches_request( @@ -3427,7 +3432,7 @@ def begin_assess_patches( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineAssessPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3487,7 +3492,7 @@ def _install_patches_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualMachineInstallPatchesResult]] @@ -3648,7 +3653,7 @@ def begin_install_patches( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualMachineInstallPatchesResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -3707,7 +3712,7 @@ def _run_command_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] @@ -3857,7 +3862,7 @@ def begin_run_command( _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-08-01")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01")) # type: Literal["2022-08-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod]